Question: Can anyone share an example of RabinMillerTest() that works? My googlefu is sadly lacking.

Here is my test code:

```
#include "integer.h"
#include "nbtheory.h"
#include "cryptlib.h"
#include "osrng.h"
#include <iostream>
int main(int argc,char *argv[])
{
    CryptoPP::RandomNumberGenerator rng;
    CryptoPP::Integer a("123456789");
    CryptoPP::Integer b;
    std::cout << a << std::endl;
    std::cout << "is prime: " << IsPrime(a) << std::endl;
    b=a+CryptoPP::Integer::Two();
    std::cout << b << std::endl;
    std::cout << "is prime: " << IsPrime(b) << std::endl;
    int r=RabinMillerTest(rng,&b,2);
    std::cout << "RabinMiller: " << r <<std::endl;
}

```

Here is the build command:

```
g++ bignum.cpp -I.  -fpermissive libcryptopp.a

```

The only example I could find is here:

<http://www.cryptopp.com/wiki/Diffie-Hellman>

My code crashes every time I run it, and one crash was so bad I had to cold boot to recover. If I remove the call to RabinMillerTest() then it runs fine. I suspect a problem with C++ syntax is the culprit, but I just don't see it. Since I can't use it properly, I am currently stripping the guts of the RabinMillerTest() function to use separately.

Answer: 
`var this.list = [];` is the problem `this.list = [];` will do...

`this.list` is not a variable, here `list` is a property of an object referred by `this` so there is no need to use `var`.

Also there is a context problem in your each loop, so

```
var Deck = Class.create({
    init: function () {
        this.list = [];
    },
    console: function () {
        console.log(this.list);
    },
    addCards: function (elemone, elemtwo, elemthree) {
        var self = this;
        $(elemone).each(function (i, el) {
            //here this referrs to the current element being iterated on, not the Deck object so use a closure variable
            var values = $(elemtwo, this).text();
            if ($(elemthree, this).text() == "2") {
                self.list.push(values);
            }
            self.list.push(values);
        });
    }
});

```
You don't need `var` in front of `this.list` — you are assigning a property to an already existing object, not creating a new one.