{"id":2989,"date":"2014-03-13T01:30:40","date_gmt":"2014-03-13T01:30:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/13\/cgccopensslsha256related-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-13T01:30:40","modified_gmt":"2014-03-13T01:30:40","slug":"cgccopensslsha256related-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/13\/cgccopensslsha256related-issues-collection-of-common-programming-errors\/","title":{"rendered":"c++,gcc,openssl,sha256Related issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/FkjBe.png?s=32&amp;g=1\" \/><br \/>\nGManNickG<br \/>\nc++ visual-c++ inclusion<br \/>\nWhen I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error:warning C4603: &#8216;_MAPTEST_H&#8217; : macro is not defined or definition is different after precompiled header use Add macro to precompiled header instead of defining here.\\MapTest.cpp(6) : use of precompiled header** \/\/ the precompiled header stdafx.h is included in this line.\\MapTest.cpp(186) : fatal error C1020: unexpected #endifbut when I add the precompiled header before the in<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8db2604afce7e3cc1f5fb796a39a2fab?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nGhita<br \/>\nc++ templates<br \/>\nI havetemplate &lt;typename ConcContainer&gt;class WebBrowsingPolicyData{public:typedef ConcContainer&lt;std::shared_ptr&lt;WBRuleDetails&gt;&gt;::iterator iterator;&#8230;private:ConcContainer&lt;std::shared_ptr&lt;WBRuleDetails&gt;&gt; usersData_;CRITICAL_SECTION critSectionI get a compile error at line (Error 6 error C2238: unexpected token(s) preceding &#8216;;&#8217;) typedef ConcContainer&lt;std::shared_ptr&lt;WBRuleDetails&gt;&gt;::iterator iteratorHow can I make a typedef inside the template ? I mu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/770924705\/picture?type=large\" \/><br \/>\nJosip Dorvak<br \/>\nc++ polymorphism pure-virtual<br \/>\nI have a class called course. Course has a pointer to a base class called Assessment.class Course{char* courseName;float fee;public:Assessment* assessment;Course();Course(Course&amp;);Course(char*, float, Assessment *);~Course();friend ostream&amp; operator &lt;&lt;(ostream&amp; os, Course&amp;); };Strickly for testing purposes, in the constructor i&#8217;m assigning the Assessment pointer to an ExamAssessment(a sub-class)Course::Course(){courseName = &#8220;something&#8221;;fee = 0;assessment = &amp;ExamAssessme<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fb5b66da10a9a12249b190f6f507b2bb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArkadiy<br \/>\nc++ algorithm matrix macros<br \/>\nI am working on a project to rotate a two dimensional array. When I use the macro to replace some codes, the results are surprising in that everything is exactly the same. The time it takes to finish the task can be significantly different. I have always thought the macro to be just a placeholder, but how could this happen?struct pixel {unsigned short red;unsigned short green;unsigned short blue; } ;\/\/n is the # of elements in the two dimensional array void rotate1(int n, pixel *src, pixel *dst)<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1768cce8ccf2dffe3483b0ab5d7cfd74?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMnementh<br \/>\nc++ visual-studio-2008<br \/>\nThe following code (simplified example, that triggers the error) doesn&#8217;t compile with VS 2008:#include &lt;math.h&gt;void test() {long long int val1 = 1;long long int val2 = 2;long long int val3 = abs&lt;long long int&gt;(val1 \/ val2); }That gives an compiler-error (C2062) on the third line &#8211; the type __int64 is unexpected. What is the reason for this error? How can it be avoided?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c2f43d6b1d79c82a463ec53effbec873?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAmokrane Chentir<br \/>\nc++ stl<br \/>\nI&#8217;ve got a very simple map :std::map&lt;int, double&gt; distances; distances[20.5] = 1; distances[19] = 2; distances[24] = 3;How do i know if there isn&#8217;t any returned value, when using a map::upper_bound() in this case for example:std::map&lt;int, double&gt;::iterator iter = distances.upper_bound(24);(24 is the max key so an unexpected result is returned, but how to know that through the code ? How to know i&#8217;ve reached the max key ?).Thanks !<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3779da46b1f7979d69605a1790d0de27?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nShantanu Gupta<br \/>\nc# c++ casting void conceptual<br \/>\nWhat will be the output if I write In C++ if(5) will be executed without any problem but not in C# same way will it be able to run.if(func()){} \/\/in C# it doesn&#8217;t runs Why how does C# treats void and how in Turbo C++void func() { return; }if(null==null){}\/\/runs in C#EDITif(printf(&#8220;Hi&#8221;){} \/\/will run and enter into if statementif(printf(&#8220;&#8221;){}\/\/will enter into else condition if found.This Question is not meant for those who are not aware of Turbo Compiler<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/HW6VJ.jpg?s=32&amp;g=1\" \/><br \/>\nDaniel Daranas<br \/>\nc++ placement-new<br \/>\nIs this safe? I&#8217;m not using any virtual functions in my actual implementation, but I&#8217;m tempted to believe that even if I was, it would still be safe.class Foo {Foo(){\/\/ initialize things}Foo( int ){new ( this ) Foo();} }<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/45ab74e5e4967303d485dbcf7cdfbddc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nstepancheg<br \/>\nc++ c windows sockets network-programming<br \/>\nI hope you can help me out. I&#8217;m trying to send packets of 1000 bits across a network via TCP\/IP and I was hoping to be able to use the Overlapped I\/O technique in both Cygwin and Windows as well.In Cygwin, I am trying to use the &#8220;readv() and writev()&#8221; function calls to send 1000 bits across while in Windows, I am trying to use the WSASend() and WSARecv() APIs in the winsock2.h header file. It seems that I can ONLY send 1000 bits from Cygwin(client.cpp) to Windows(server.cpp). More than 1000 bits<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3a3e75bf9bf7d485682fd19aba36fa89?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1858268<br \/>\nc++ sorting pivot quicksort<br \/>\nI have an assignment to implement a dual pivot quicksort algorithm. It seems to be working for vectors with small amounts of numbers, but when I try to sort a vector with for example 100000 I get segmentation fault. Any help? void quicksort_dual_pivot(vector &lt;int&gt; &amp;A, int L, int R) {if(L&gt;=R) return; int spivot = A[L]; \/\/Error here.int bpivot = A[R]; if(spivot &gt; bpivot){swap(A[R],A[L]);swap(spivot,bpivot); }int l = L+1; int g = R-1; for(int k=l;k&lt;=g;k++){if(A[k] &lt; spivot<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/07123541fba3343f9ddb5876595b99a7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAlex<br \/>\nc gcc linux-kernel kernel driver<br \/>\nCan I use #include &lt;stdatomic.h&gt; and atomic_thread_fence() with memory_order from C11 in Linux driver (kernel-space), or do I must to use Linux functions of memory-barriers: http:\/\/lxr.free-electrons.com\/source\/Documentation\/memory-barriers.txt http:\/\/lxr.free-electrons.com\/source\/Documentation\/atomic_ops.txtUsing:Linux-kernel 2.6.18 or greater GCC 4.7.2 or greater<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4b54a3d274fee21ed3f55bc42baaddbe?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWill Bradley<br \/>\nc++ gcc syntax clang gcc-warning<br \/>\nI&#8217;d like to have the compiler warn me if I&#8217;m not handling every if statement&#8217;s else condition. Does this exist in either clang or gcc?To clarify, I&#8217;m not trying to have this be on for all of my source code. However, there are sometimes entire files or large swaths of code for which I simply cannot afford to not think hard about every single else block, by design. So, I suppose, I&#8217;m really looking for a pragma I can turn on and off to enable and disable this for a few thousands of lines of ver<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0dd45f9e7d956ca2062968f0bd002f8c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nphilippe<br \/>\nc++ c gcc g++ dynamic-linking<br \/>\nI&#8217;m currently writing an interface between a very low level C program to a higher level C++ program. The way they relate is through a linked list: The C program has a linked list, and the interface takes the information stored in each node in the linked list and converts that to a C++ vector. The process itself it&#8217;s not a program. The problem is how to call that C++ function from the C program. Let me give you some light on that:int importData(List *head, char * source, char * dest);is declared<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/291ddc5d555c7fbb880332f3665c87b4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHomunculus Reticulli<br \/>\nc gcc<br \/>\nI am getting the following warning: warning: left-hand operand of comma expression has no effectThe macros are defined below. I am compiling with GCC (4.4.3) on Linux. It is C code.#define MY_MAX(a,b) \\({ __typeof__ (a) _a = (a); \\__typeof__ (b) _b = (b); \\_a &gt; _b ? _a : _b; })#define MY_MIN(a,b) \\({ __typeof__ (a) _a = (a); \\__typeof__ (b) _b = (b); \\_a &lt; _b ? _a : _b; })How do I fix them to get rid of the warnings?[[Update]]Actually, I found the cause of the warning. It had nothing to do<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fe497c28efb01545c16cd7e25a3dedaa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGeeF<br \/>\nlinux gcc linker shared-libraries ld<br \/>\nI&#8217;m sitting on an OpenSuse 11.1 x64 Box and I have a module that uses sigc++. When linking like this:g++ [a lot of o&#8217;s, L&#8217;s and l&#8217;s] -lsigc-2.0I get\/usr\/lib64\/gcc\/x86_64-suse-linux\/4.3\/..\/..\/..\/..\/x86_64-suse-linux\/bin\/ld: cannot find -lsigc-2.0However the library is there. In the filesystem:$ sudo find \/ -name &#8220;libsigc-2.0*&#8221; \/usr\/lib64\/libsigc-2.0.so.0.0.0 \/usr\/lib64\/libsigc-2.0.so.0 \/usr\/lib64\/libsigc-2.0.soIn ld.so.conf I have:\/usr\/lib64And when invoking ldconfig:$ ldconfig -v | grep sigc lib<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/98fb8860a22e8e9bce0f711483f2afcc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWinmass<br \/>\nc pointers gcc libc<br \/>\nI am learning pointer in c i have written a small program , but i am getting segmentaion fault i dont know where i am having the issue please let me know the issue with the code , it is an array of pointers to string , which is in a pointer to structure . # include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;# include &lt;string.h&gt; char *sum(char **sol) ;char *summer_sum(char*** solcs) ; int main() { char* datum =&#8221;teststring&#8221;; sum(&amp;datum); }char *sum(char** sol) { printf(&#8220;\\n value<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2f786b1ad349a30e02802ae61b4518fc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDan D.<br \/>\nobjective-c gcc llvm clang<br \/>\nThe following code implements an NSProxy subclass which forwards methods to an NSNumber instance.However when calling [nsproxy floatValue] I get 0.0 under GCC 4.2.Under LLVM-Clang I get the correct answer 42.0.Any idea what is going on?(by the way this is running under Garbage Collection)-(id) init; {_result = [NSNumber numberWithFloat:42.0];return self; }- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {return [[_result class] instanceMethodSignatureForSelector:aSelector]; }- (v<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a3739a0c73f29e189d798c2a96ba4d7c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFelixyz<br \/>\nobjective-c gcc compiler grammar keyword<br \/>\nAt the CocoaHeads \u00d6resund meeting yesterday, peylow had constructed a great ObjC quiz. The competition was intense and three people were left with the same score when the final question was to be evaluated: How many reserved keywords does Objective-C add to C?Some spirited debate followed. All agreed that @interface, @implementation etc are all pre-processor directives rather than keywords, but how about something like in? It might be a keyword, but it&#8217;s not a reserved keyword. For example, the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ef911e1dffe26625ae43f8d1cd1ac70e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAgnius Vasiliauskas<br \/>\nc++ visual-studio-2010 gcc exception-handling exception-specification<br \/>\nWhat is the standard behavior in cases when function throws exception not in valid exception list ? For example when I run this code:#include &lt;iostream&gt; #include &lt;cstdlib&gt;using namespace std;void NotLegal() throw(char) {throw 42; }void myunexpected () {cout &lt;&lt; &#8220;exception not in list\\n&#8221;;cin.get();exit(0); }int main() {set_unexpected(myunexpected);try {NotLegal();}catch(&#8230;) {cout &lt;&lt; &#8220;exception catched&#8221;;cin.get();}return 0; }It behaves differently on GCC and Visual Studio C<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c19bd96808c0e21a4e3ad6611dc5c8a8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGarrappachc<br \/>\nc++ c linux gcc gnu<br \/>\nI am writing the class for handling matrices (no suprise here &#8211; the name is Matrix). I was suprised when it turned out that I cannot use minor() method name that counts the minor matrix. The name is #defined in sys\/syscalls.h. Is there a way to get rid of it?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/673d1e3f15cb30eec0a0eeace9eb1c9a?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\npajooh<br \/>\ngit openssl debian gnutls<br \/>\nrecently, trying to clone a git repo from my debian(jessie) box, i&#8217;m facing this:fatal: unable to access &#8216;https:\/\/github.com\/foo\/bar\/&#8217;: gnutls_handshake() failed: A TLS packet with unexpected length was received.as mentioned by ubuntu folks i used the git compiled with openssl, and now i get:fatal: unable to access &#8216;https:\/\/github.com\/foo\/bar\/&#8217;: Unknown SSL protocol error in connection to github.com:443<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5d0a36ca4fb567c2e4845c03ac698a36?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMax<br \/>\nruby nginx openssl unicorn savon<br \/>\nHaving a hard time getting up and running with rails (3.1) app on private vps (Ubuntu 10.04.4 LTS).Getting error below when using savon to call a soap serviceOpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2\/v3 read server hello A: sslv3 alert unexpected message): lib\/modules\/soap_client.rb:32:in `create_payment&#8217; app\/controllers\/payments_controller.rb:34:in `create&#8217;Strange as this exactly same application code works without a problem over at Heroku were I hosting it now as a res<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4a373a79b0b8b47a11ec70974669f469?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAstron<br \/>\nmysql shell scripting openssl mysqldump<br \/>\nA portion of a script I use to backup MySQL databases has stopped working correctly after upgrading a Debian box to 6.0 Squeeze. I have tested the backup code via CLI and it works fine. I believe it is in the selection of the databases before the backup occurs, possibly something to do with the $skipdb variable. If there is a better way to perform the function then I&#8217;m will to try something new. Any insight would be greatly appreciated.$ sudo .\/script.sh [: 138: information_schema: unexpected op<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/47867063d0ac506b9f90080a708e7f55?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmarketer<br \/>\nruby openssl mechanize<br \/>\nI&#8217;m trying to connect to the server https:\/\/www.xpiron.com\/schedule in a ruby script. However, when I try connecting:require &#8216;open-uri&#8217; doc = open(&#8216;https:\/\/www.xpiron.com\/schedule&#8217;)I get the following error message:OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2\/v3 read server hello A: sslv3 alert unexpected message from \/usr\/local\/lib\/ruby\/1.9.1\/net\/http.rb:678:in `connect&#8217;from \/usr\/local\/lib\/ruby\/1.9.1\/net\/http.rb:678:in `block in connect&#8217;from \/usr\/local\/lib\/ruby\/1.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ca1dd31407ed70ba83964d366312b9ca?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nGeoff Lanotte<br \/>\nruby openssl httpclient soap4r<br \/>\nI am working against the level3 SOAP API. Everything was working wonderfully until recently when OpenSSL was updated. Here is the full output of the error message:OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2\/v3 read server hello A: sslv3 alert unexpected message):httpclient (2.1.5.2) lib\/httpclient\/session.rb:247:in `connect&#8217;httpclient (2.1.5.2) lib\/httpclient\/session.rb:247:in `ssl_connect&#8217;httpclient (2.1.5.2) lib\/httpclient\/session.rb:639:in `connect&#8217;httpclient (2.1.5.2<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f60f5d0572caa66932a33b7054ed36b3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSteve<br \/>\npostfix ssl-certificate dovecot openssl<br \/>\nI&#8217;ve been trying to get Postfix and Dovecot set up for days and I think I have resolved all problems except for one that just came up. When I try to restart Dovecot I get the following error message:doveconf: Fatal: Error in configuration file \/etc\/dovecot\/dovecot.conf: ssl enabled, but ssl_cert not set [&#8230;.] Restarting IMAP\/POP3 mail server: dovecotdoveconf: Fatal: Error in configuration file \/etc\/dovecot\/dovecot.conf: ssl enabled, but ssl_cert not setWhen I check dovecot.conf, there is not<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2fd086bbee878b27d9e77065bc445f3f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDaniel Kauffman<br \/>\nsecurity ssh openssl ssh-keygen<br \/>\nFrom man 8 sshd with regards to the Authorized Keys File Format and the command=&#8221;command&#8221; option:Note that this command may be superseded by either an sshd_config(5) ForceCommand directive or a command embedded in a certificate.Using ssh-keygen -O force-command=&#8221;command&#8221; allows a command to be embedded in a certificate. But how does one verify that a command has not been embedded in a certificate? Along these same lines of preventing unexpected commands from being executed, does ForceCommand a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7b0b1f0c80b17abb9b5daece7d94b1c8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ne-sushi<br \/>\nencryption implementation file-encryption openssl<br \/>\nI have recently begun studying crypto. If it&#8217;s one thing I have learned it&#8217;s that we should not implement our own crypto. Therefore we should look to using existing software and libraries.When I go to implement something that needs data security, there are many options &#8212; openssl, mcrypt, truecrypt, crypt, pycrypto, bouncycastle&#8230; how do I know what is &#8220;tried and true&#8221; with regard to crypto community scrutiny? This probably depends on the application, your implementation language, and the data<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8fcf279def5c1abd4cdf30b974dd8787?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDavid<br \/>\njava security openssl keystore jdk1.6<br \/>\nI&#8217;ve a problem with the enum return value of KeyStore.aliases();FileInputStream is = new FileInputStream(&#8220;\/tmp\/file.p12&#8221;); List&lt;String&gt; aliases = new ArrayList&lt;String&gt;();KeyStore keystore = KeyStore.getInstance(&#8220;PKCS12&#8221;); keystore.load(is, password.toCharArray()); is.close();Enumeration&lt;String&gt; e=keystore.aliases(); while(e.hasMoreElements()) {\/\/ never reaches here because &#8220;e&#8221; is emptySystem.out.println(e.nextElement().toString());i++; }With Java version &#8220;1.6.0_22&#8221; Java(TM) SE<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/16bebb36e0e28572a316ba0450e190d1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nentropy<br \/>\nwindows-phone-8 windows-runtime openssl runtime winsock<br \/>\nHow to build OpenSSL for WP8?AFAIK, we must replace winsock.h by winsock2.h because WP8 only supports winsock2.h. And maybe we must replaces code to target WinRT architecture on WP8 (ThreadPool, &#8230;)The caveat is that we must build OpenSSL as WP8 static library, so that the output lib can be wrapped by WP8 runtime component, right ?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fc763c6ff6c160ddad05741e87e517b6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBill the Lizard<br \/>\njava bouncycastle sha256 elliptic-curve<br \/>\nI am trying to generate a signature using ECDSA with SHA256 in Bouncy Castle as follows,I add the provider in the begining I have built the ECPrivatekey Signature s_oSignature = Signature.getInstance(&#8220;SHA256withECDSA&#8221;, BouncyCastleProvider.PROVIDER_NAME);but step 3 throws &#8220;java.security.NoSuchAlgorithmException: no such algorithm: SHA256withECDSA for provider BC&#8221;.But same &#8220;SHA256withECDSA&#8221; thing when replaced with &#8220;SHA1withECDSA&#8221; prceeds without any exception.How is it possible? I am using<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/EvJ6I.jpg?s=32&amp;g=1\" \/><br \/>\nShehab Fawzy<br \/>\nc# windows-8 sha256<br \/>\nSo in the old days I used to use System.Security.Cryptography which is not available in windows 8. what i found in windows 8 was windows.security but i didn&#8217;t find any examples on how to use Sha256 with a key. This is the old code that I used with System.Security.Cryptographystring appID = &#8220;appid&#8221;;string key = &#8220;password&#8221;;var hmacsha256 = new HMACSHA256(Encoding.Default.GetBytes(key));hmacsha256.ComputeHash(Encoding.Default.GetBytes(appID));string k = &#8220;&#8221;;foreach (byte test in hmacsha256.Hash){k +<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e6d21660f6efe05ce22e89cfb9318356?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMcDermott<br \/>\nios objective-c hash sha256<br \/>\nI want to create hash from a string. If the string has characters with accent (like \u00e9, o), it crashes with NSASCIIStringEncoding. It doesn&#8217;t crash with NSUTF8StringEncoding, but on the server it doesn&#8217;t match.+(NSString *) getSHA256FromString: (NSString *)clear {const char *s=[clear cStringUsingEncoding: NSASCIIStringEncoding];\/\/ NSUTF8StringEncoding works, but isn&#8217;t the same on serverNSData *keyData=[NSData dataWithBytes:s length:strlen(s)];uint8_t digest[CC_SHA256_DIGEST_LENGTH]={0};CC_SHA256(<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/490e6a4234c359f7d60ccee45d2aee86?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\naliasm2k<br \/>\nphp sha256 bitcoin<br \/>\nI am making a bitcoin faucet using the coinbase api, and was looking to validate the address. I looked online to see if there are any good scripts, and couldnt find any so I decided to test and see if it was already built in the API, and it was! The the thing is that instead of just saying that is not a valid address it php displays a LONG error&#8230; Fatal error: Uncaught exception &#8216;Coinbase_ApiException&#8217; with message &#8216;Please enter a valid email or bitcoin address&#8217; in C:\\xampp\\htdocs\\nahtnam\\lib\\C<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/43a95aa8198e8e2090bc2bfb936ac867?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2782324<br \/>\nsha256<br \/>\nI was trying to use the sha2.c file from polarssl at this link,https:\/\/polarssl.org\/sha-256-source-codeI am actually quite a newbie to this, but I was able to get this on Eclipse and when I tried to build it, it gives the errorc:\/mingw\/x86_64-w64-mingw32\/lib\/..\/lib\/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x3d): undefined reference to `WinMain&#8217;do I have to pass some kind of data in the arguments? how can I find out how to use it?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3e72cbdf423835d8ddd43f8aff743600?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmillinon<br \/>\nc++ gcc openssl sha256<br \/>\nI&#8217;m writing a program to get myself acquainted with OpenSSL, libncurses, and UDP networking. I decided to work with OpenSSL&#8217;s SHA256 to become familiar with industry encryption standards, but I&#8217;m having issues with getting it working. I&#8217;ve isolated the error to the linking of OpenSSL with the compiled program. I&#8217;m working on Ubuntu 12.10, 64 bit. I have the package libssl-dev installed.Take, for instance, the C++ main.cpp:#include &lt;iostream&gt; #include &lt;sstream&gt; #include &lt;string&gt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ecdd712b4cb09a101bb2dc23c74329a8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFrosty Z<br \/>\nphp encryption undefined trim sha256<br \/>\nI have this php code:$password = sha256($_POST[&#8216;password&#8217;]);but when I run this code it says:Fatal error: Call to undefined function sha256() in &#8230;. on line &#8230;ix it as What is wrong with this code and what must I do to fix this as I know that sha256 exists.I have also tried:$password = sha256(trim($_POST[&#8216;password&#8217;]));But that doesn&#8217;t work either.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/46a6db74ccc3bf4e009f875283401c14?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThomasReggi<br \/>\nnode.js cryptography hmac sha256<br \/>\nI can make an HMAC using the following:var encrypt = crypto.createHmac(&#8220;SHA256&#8221;, secret).update(string).digest(&#8216;base64&#8217;);I am trying to decrypt an encoded HMAC with the secret:var decrypt = crypto.createDecipher(&#8220;SHA256&#8221;, secret).update(string).final(&#8220;ascii&#8221;);The following was unsuccessful. How can I decrypt a HMAC with the key?I get the following error:node-crypto : Unknown cipher SHA256crypto.js:155return (new Decipher).init(cipher, password);^ Error: DecipherInit error<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GManNickG c++ visual-c++ inclusion When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error:warning C4603: &#8216;_MAPTEST_H&#8217; : macro is not defined or definition is different after precompiled header use Add macro to precompiled header instead of defining here.\\MapTest.cpp(6) : use of precompiled [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2989","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2989"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2989\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}