• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rabin Miller begining

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is my rough code for Rabin Miller....(without next probable and witness)
i wrote this code..with help of William Stallings..for network security..and cryptography

i wanaa to write it..myself..

guyz..i have tested many times the code..but it didnt give Prime Number
is there any problem with the code.....then please..point out...it's very very important for me.....or suggest me to generate prime no. using other ways..

thanks....


 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
You didn’t use the code button correctly, but I have sorted that out. I also got rid of lots of unnecessary tags and excess whitespace, which makes the code more difficult to read.
Wny have you got comments like // BigInt for n, rather than simply calling the variable n? You also have too many imports. Isn’t there a BigInteger.ONE object ready for you to use?
You cannot work out the algorithm by reading the code. You need to write the algorithm on paper, and then carefully translate that to code. Have you done that? That is probably the only way you can sort out the problem.
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic