Re: Crypto++ 5.6.5 and Valgrind

2017-11-29 Thread Ingo Naumann
Hi,

>> You might be able to work around it by removing the `-march=native`
>> from CXXFLAGS. Open GNUmakefile and delete the line that adds it.
>> However, you will loose a fair amount of performance because the
>> source files depend on some of the options included in
>> `-march=native`.
Wo-ho! This one saves my day! Valgrind's smiling at me again. :)

I.

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Crypto++ 5.6.5 and Valgrind

2017-11-29 Thread Ingo Naumann
Hi,

Thanks a lot for your answer.

> I've just upgraded from an older version to Crypto++ 5.6.5 and my
> Valgrind is seriously unhappy about it. Even the "cryptest.exe v"
> command crashes with "Illegal instruction" (details on request) when
> calling it with
>
>
> []
> We work around it by building Valgrind from sources. Its fairly easy
> once you install the packages "automake autoconf libtool". Also see
> http://valgrind.org/downloads/repository.html.

Hmmm. I had built valgrind from the "current" source, ie version
3.13 from June 2017.

So now I've upgraded to valgrind-3.14.0.GIT (cloned ten minutes ago) but
it yields the same result. I'm hitting illegal instructions in both
"cryptest.exe" as well as my own software (during ECDSA key generation).

But if nobody else can confirm this I'll probably either re-install and
start from a scratch and/or perform a memory check with another tool and
see what comes up.

Ingo

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Crypto++ 5.6.5 and Valgrind

2017-11-28 Thread Ingo Naumann
Dear All,

I've just upgraded from an older version to Crypto++ 5.6.5 and my
Valgrind is seriously unhappy about it. Even the "cryptest.exe v"
command crashes with "Illegal instruction" (details on request) when
calling it with

valgrind --tool=memcheck --leak-check=full --show-reachable=yes
./cryptest.exe v

as suggested here:

https://www.cryptopp.com/wiki/Profiling

Could anybody confirm or is that just me seeing that?

System is Debian 4.9.0-3-686-pae, gcc (Debian 6.3.0-18) 6.3.0 20170516
in a Virtual Machine (VMWare).

Cheers,

Ingo



-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CryptoPP build/install on Fedora 26

2017-09-25 Thread Ingo Naumann
In which directory does Cryptopp install the file libcryptopp.so.5.6? In
/usr/lib or in /usr/local/lib?


On 09/25/2017 06:40 PM, Richard Závodný wrote:
> I installed CPP using dnf (*cryptopp* package), that's all. Now i
> tried to build the library using guide on wiki page you posted, but
> still it don't work. :(
>
> On  Monday, 25 September 2017 18:03:10 UTC+2, Jeffrey Walton wrote:
>
>
>
> On Monday, September 25, 2017 at 11:54:44 AM UTC-4, Richard
> Závodný wrote:
>
> Right now i'm getting *error while loading shared libraries:
> libcryptopp.so.5.6: cannot open shared object file: No such
> file or directory* error. Why? How to fix it. BTW. I also use
> *-lcryptopp* as a param using g++ command. Is this param
> right? When I change it to -lcrypto++ I get the */usr/bin/ld:
> cannot find -lcrypto++*, so i think that -lcryptopp is ok, but
> not sure about it.
>
>
> No ideas. You have not told us what you have done, so there's not
> much for us to suggest. The Linux page on the wiki will probably
> be helpful for you if you have not compiled and linked before.
> Also see https://www.cryptopp.com/wiki/Linux
> .
>
> If you want to work the shared object issue, then you might try
> 
> https://stackoverflow.com/questions/480764/linux-error-while-loading-shared-libraries-cannot-open-shared-object-file-no-s
> 
> 
> and
> 
> https://lonesysadmin.net/2013/02/22/error-while-loading-shared-libraries-cannot-open-shared-object-file/
> 
> 
>
> Jeff
>
> -- 
> -- 
> You received this message because you are subscribed to the "Crypto++
> Users" Google Group.
> To unsubscribe, send an email to
> cryptopp-users-unsubscr...@googlegroups.com.
> More information about Crypto++ and this group is available at
> http://www.cryptopp.com.
> ---
> You received this message because you are subscribed to the Google
> Groups "Crypto++ Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cryptopp-users+unsubscr...@googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: library not found error on Mountain Lion

2012-08-26 Thread Ingo Naumann
Hi,

 I'm trying to compile a c++ program that I inherited support of, and running
 into some issues when trying to compile it on Mountain Lion, with XCode
 4.4.1 installed, and g++ (gcc) v4.2.1.

 $ g++ -arch x86_64 -I cryptopp -l cryptopp -o my_program.cpp

I'm not sure why you'd need '-l cryptopp' twice...

 Here's the error that I'm running into when compiling:

 ld: library not found for -lcryptopp
 collect2: ld returned 1 exit status

Does cryptopp compile properly (using 'make')? Where do you have the
'libcryptopp.*' file(s)?

Ingo

-- 
You received this message because you are subscribed to the Crypto++ Users 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.


Re: CryptoPP: RSA Signature Scheme causes a Segmentation Fault

2012-07-14 Thread Ingo Naumann
Dear Michele,

How do you initialize the string variable Sign?

And, BTW, one comment on item 4) in your first mail. The command you
are using in your code is for signing a message. The message gets
hashed and then the RSA function is applied to this hash (simplified
explanation). In your case, your RIPEMD128 hash (stored in Digest)
will be re-hashed with a SHA1 and then RSA'ed. If that's what you
want, you are on the right track.

Ingo

-- 
You received this message because you are subscribed to the Crypto++ Users 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.


Re: CryptoPP: RSA Signature Scheme causes a Segmentation Fault

2012-07-14 Thread Ingo Naumann
I believe that you should declare the variable Sign in your method
SignHash and maybe you should not have named it Sign because you
are using that for some other things already.

I am referring to the variable inside the StringSink command. So,
tru to rename that into result, or whatever, and initialize it with
string result; before using it: StringSink(result).


On Sat, Jul 14, 2012 at 7:08 PM, Michele michelegucciard...@gmail.com wrote:
 Hi Ingo,
 what i want is sign the RIPEMD128 hash and the sign it. I choose RSA because
 it is most common and available in cryptopp, and its signature scheme use
 SHA1...

 Variable string Sign is the end of StringSink, i define it in class Sign
 (chek my last post) and i initialize that so:

 void SignHash()
 {
 DigitalSign = ;
 }

 Il giorno sabato 14 luglio 2012 18:47:49 UTC+2, Ingo Naumann ha scritto:

 Dear Michele,

 How do you initialize the string variable Sign?

 And, BTW, one comment on item 4) in your first mail. The command you
 are using in your code is for signing a message. The message gets
 hashed and then the RSA function is applied to this hash (simplified
 explanation). In your case, your RIPEMD128 hash (stored in Digest)
 will be re-hashed with a SHA1 and then RSA'ed. If that's what you
 want, you are on the right track.

 Ingo

 --
 You received this message because you are subscribed to the Crypto++ Users
 Google Group.
 To unsubscribe, send an email to
 cryptopp-users-unsubscr...@googlegroups.com.
 More information about Crypto++ and this group is available at
 http://www.cryptopp.com.

-- 
You received this message because you are subscribed to the Crypto++ Users 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.


GDSA: Bit length of private key

2010-08-24 Thread Ingo Naumann
Hi All,

I haven't received an answer, so I am giving it another try Does
anybody have a clue?

Ingo

-- Forwarded message --
From: Ingo Naumann cyberurc...@gmail.com
Date: Fri, Aug 13, 2010 at 3:44 PM
Subject: GDSA: Bit length of private key
To: Crypto++ Users cryptopp-users@googlegroups.com


Hi Wei and All,

I am experiencing problems with DSA key generation. For some reasons,
when I select the pair (2048 bit, 256 bit) as parameter size, only the
prime divisor q is of 256 bit, but the private key (x) is of 224 bit.
The other three values are ok. It does work properly with the other
two long combinations (3072 bit, 256 bit) and (2048 bit, 224 bit),
as specified by FIPS 186-3, chapter 4.2.

See code and example below.

Any clues? Is that a bug in the library or am I missing something?

Ingo

Source:

       CryptoPP::AutoSeededRandomPool rng;
       CryptoPP::GDSACryptoPP::S (see below)::Signer GDSAprKey;
       // Generate Private Key
      GDSAprKey.AccessKey().GenerateRandom(rng,
CryptoPP::MakeParameters(CryptoPP::Name::M
odulusSize(), L)(CryptoPP::Name::SubgroupOrderSize(), N));

Table:

S: SHA1

L: 1024, N: 160 -- q: 160 bits, x: 224 bits

S: SHA224

L: 2048, N: 224 -- q: 224 bits, x: 224 bits
L: 2048, N: 256 -- q: 256 bits, x: 224 bits (!)
L: 3072, N: 256 -- q: 256 bits, x: 256 bits

S: SHA256

L: 2048, N: 256 -- q: 256 bits, x: 224 bits (!)
L: 3072, N: 256 -- q: 256 bits, x: 256 bits

Private Key (S=SHA256, L=2048, N=256):

30 : SEQUENCE (Length: 0x261)
 02 : Integer (Length: 0x01)
     00
 30 : SEQUENCE (Length: 0x239)
 06 : Object Identifier (OID): 1.2.840.10040.4.1 dsa
 30 : SEQUENCE (Length: 0x22C)
  02 : Integer (Length: 0x101)
       00
       AF A3 1E F2 96 B6 2B 67 FB BA 25 E3 CB F4 AC C0 A1 65 37 32
       28 0E 79 82 7B DD D3 A4 21 09 99 5F F8 BB 19 4F 5E 26 CB F4
       6A 55 B0 D1 CF BE B7 73 47 16 90 76 A8 88 1E 0B 47 C1 68 58
       E7 E7 75 33 BC 2B 5F 34 38 C0 60 0B B1 62 5A 4D 44 CB 62 BA
       [0xB0 bytes skipped.]
  02 : Integer (Length: 0x21)
       00
       A1 FA 6E 89 04 90 F7 8C 26 69 69 EB 5E 57 01 B8 1A 8C 76 E9
       E7 6E F8 B6 64 AE F2 B5 2F C1 E2 D7
  02 : Integer (Length: 0x100)
       0C 8E 25 A6 59 FB F6 87 6D 04 0E CD D3 8B A8 40 AD 49 BC 36
       97 F7 D1 15 83 66 9C CD A5 E9 FD FA 77 50 7D 86 23 CC 37 F0
       71 8B 21 63 24 13 4C 48 A6 2D F9 20 FE F6 49 DE B3 94 C4 93
       CB D4 BD 60 97 DF 8E 11 5B 20 B6 01 EC C6 3F 95 4D 27 F0 35
       [0xB0 bytes skipped.]
 04 : Octet String (Length: 0x1F)
 02 : Integer (Length: 0x1D)
     03 3E 86 6B 8C 09 DD BB 39 01 F6 A3 72 1C 97 F5 47 87 55 DC
     C8 3D 12 14 8E D4 5C F2 9A

-- 
You received this message because you are subscribed to the Crypto++ Users 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.


GDSA: Bit length of private key

2010-08-13 Thread Ingo Naumann
Hi Wei and All,

I am experiencing problems with DSA key generation. For some reasons,
when I select the pair (2048 bit, 256 bit) as parameter size, only the
prime divisor q is of 256 bit, but the private key (x) is of 224 bit.
The other three values are ok. It does work properly with the other
two long combinations (3072 bit, 256 bit) and (2048 bit, 224 bit),
as specified by FIPS 186-3, chapter 4.2.

See code and example below.

Any clues? Is that a bug in the library or am I missing something?

Ingo

Source:

CryptoPP::AutoSeededRandomPool rng;
CryptoPP::GDSACryptoPP::S (see below)::Signer GDSAprKey;
// Generate Private Key
   GDSAprKey.AccessKey().GenerateRandom(rng,
CryptoPP::MakeParameters(CryptoPP::Name::M
odulusSize(), L)(CryptoPP::Name::SubgroupOrderSize(), N));

Table:

S: SHA1

L: 1024, N: 160 -- q:  bits, x:  bits

S: SHA224

L: 2048, N: 224 -- q: 224 bits, x: 224 bits
L: 2048, N: 256 -- q: 256 bits, x: 224 bits (!)
L: 3072, N: 256 -- q: 256 bits, x: 256 bits

S: SHA256

L: 2048, N: 256 -- q: 256 bits, x: 224 bits (!)
L: 3072, N: 256 -- q: 256 bits, x: 256 bits

Key (S=SHA256, L=2048, N=256):

30 : SEQUENCE (Length: 0x261)
 02 : Integer (Length: 0x01)
  00
 30 : SEQUENCE (Length: 0x239)
  06 : Object Identifier (OID): 1.2.840.10040.4.1 dsa
  30 : SEQUENCE (Length: 0x22C)
   02 : Integer (Length: 0x101)
00
AF A3 1E F2 96 B6 2B 67 FB BA 25 E3 CB F4 AC C0 A1 65 37 32
28 0E 79 82 7B DD D3 A4 21 09 99 5F F8 BB 19 4F 5E 26 CB F4
6A 55 B0 D1 CF BE B7 73 47 16 90 76 A8 88 1E 0B 47 C1 68 58
E7 E7 75 33 BC 2B 5F 34 38 C0 60 0B B1 62 5A 4D 44 CB 62 BA
[0xB0 bytes skipped.]
   02 : Integer (Length: 0x21)
00
A1 FA 6E 89 04 90 F7 8C 26 69 69 EB 5E 57 01 B8 1A 8C 76 E9
E7 6E F8 B6 64 AE F2 B5 2F C1 E2 D7
   02 : Integer (Length: 0x100)
0C 8E 25 A6 59 FB F6 87 6D 04 0E CD D3 8B A8 40 AD 49 BC 36
97 F7 D1 15 83 66 9C CD A5 E9 FD FA 77 50 7D 86 23 CC 37 F0
71 8B 21 63 24 13 4C 48 A6 2D F9 20 FE F6 49 DE B3 94 C4 93
CB D4 BD 60 97 DF 8E 11 5B 20 B6 01 EC C6 3F 95 4D 27 F0 35
[0xB0 bytes skipped.]
 04 : Octet String (Length: 0x1F)
 02 : Integer (Length: 0x1D)
  03 3E 86 6B 8C 09 DD BB 39 01 F6 A3 72 1C 97 F5 47 87 55 DC
  C8 3D 12 14 8E D4 5C F2 9A

-- 
You received this message because you are subscribed to the Crypto++ Users 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.