- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
ippsRSAGenerate keeps crashing. What's the problem with that code:
-static const Ipp32u dataE[] = {65537};
static const int keyLen = 2048;
primeLen_ = keyLen/2;
//pseudo-random engine
int rngSize;
ippsPRNGGetSize(&rngSize);
IppsPRNGState* pRNG = (IppsPRNGState*)ippsMalloc_8u(rngSize);
int MaxSeedBitsize=512;
ippsPRNGInit(MaxSeedBitsize, pRNG);
// Give entropy to the PRNG
BigNum b(data32Len);
b.Randomize();
status=ippsPRNGSetSeed(b.GetBN(), pRNG);
...
BigNum publicExponent(sizeof(dataE)/sizeof(dataE[0]));
publicExponent.Set(1,dataE); // calls ippsSet_BN
ippsRSAGenerate(
publicExponent.GetBN(),
keyLen_,
primeLen_,
gen_t(primeLen_),
pRSADecKey_,
ippsPRNGen,
pRNG
);
with :
int gen_t(int kp)
{
int t;
t = 27;
if(kp>150) t = 18;
if(kp>200) t = 15;
if(kp>250) t = 12;
if(kp>300) t = 9;
if(kp>350) t = 8;
if(kp>400) t = 7;
if(kp>450) t = 6;
return t;
}
Any suggestions will be very helpful Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]int gen_t(int kp) { int t; t = 27; if(kp>150) t = 18; if(kp>200) t = 15; if(kp>250) t = 12; if(kp>300) t = 9; if(kp>350) t = 8; if(kp>400) t = 7; if(kp>450) t = 6; return t; } [/cpp]
Vladimir
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code you provide does ot compile. I would recommend you to carefully check parameters you use for IPP function call (please also refer to IPP documentation to see if any limitations have to be considered)
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code you provide does ot compile. I would recommend you to carefully check parameters you use for IPP function call (please also refer to IPP documentation to see if any limitations have to be considered)
Vladimir
Hi ,
Thanks for your reply. The code does actually compile. But I did not want to paste all parts in this thread. So I try to replicate a kind of pseudo-code for it.
Anyway thanks, I fixed the problem.
Now my problem with ippsRSAGenerate is the t=nTrials Security parameter specified for the Miller-Rabin probable primality . When I use nTrials values derived from the Miller-Rabin pure theory , the program takes too much time to compute. It just to much calculations.
I'm using 2048-bit and 3072-bit keys. Do you have any suggestions ( tradoffs ) about nTrials values ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]int gen_t(int kp) { int t; t = 27; if(kp>150) t = 18; if(kp>200) t = 15; if(kp>250) t = 12; if(kp>300) t = 9; if(kp>350) t = 8; if(kp>400) t = 7; if(kp>450) t = 6; return t; } [/cpp]
Vladimir
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page