From 78c0815c4118fe24ab78cce2dc48a6232dcd824a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Jun 2012 20:55:18 +0000 Subject: - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/cpp_rsau.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/CryptoPP/cpp_rsau.cpp') diff --git a/plugins/CryptoPP/cpp_rsau.cpp b/plugins/CryptoPP/cpp_rsau.cpp index 6644e715fa..be8e499ed1 100644 --- a/plugins/CryptoPP/cpp_rsau.cpp +++ b/plugins/CryptoPP/cpp_rsau.cpp @@ -6,14 +6,14 @@ const string padding = "PADDING!PADDING!PADDING!PADDING!"; // 256 bit string pad256(string& str) { string out = str; int pad = out.length() % 32; - if( pad ) { // надо выровнять на 256 бит - if( pad>3 ) { + if ( pad ) { // надо выровнять на 256 бит + if ( pad>3 ) { out += tlv(0,padding.substr(0,32-3-pad)); } else { - if( pad==3 ) out += string("\0\0\0"); + if ( pad==3 ) out += string("\0\0\0"); else - if( pad==2 ) out += string("\0\0"); + if ( pad==2 ) out += string("\0\0"); else out += string("\0"); } } @@ -23,7 +23,7 @@ string pad256(string& str) { string& add_delim(string& str, const string& del, int len) { string val; - for( u_int i=0; i 3 ) { + if ( b.length() > 3 ) { t = 0; b.copy((char*)&t,3); u_int l = t>>8; t &= 0xFF; - if( b.length() >= 3+l ) { + if ( b.length() >= 3+l ) { v = b.substr(3,l); r = b.substr(3+l); } } - if( !v.length() ) { + if ( !v.length() ) { t = -1; } b = r; @@ -95,7 +95,7 @@ string& un_tlv(string& b, int& t, int& v) { int str2int(string& s) { int v = 0; - if( s.length()<=sizeof(int) ) + if ( s.length()<=sizeof(int) ) s.copy((char*)&v,s.length()); return v; } -- cgit v1.2.3