Error Testing Integer Operation on 8.2

13 views
Skip to first unread message

Benyamin Limanto

unread,
Jul 1, 2020, 12:29:20 AM7/1/20
to Crypto++ Users
Hello I tried to run the test operation on VS 2017 and got error
Testing Integer operations...

Assertion failed: d:\users\ben\my desktop\crypto\cryptopp\integer.cpp(4408): CryptoPP::a_times_b_mod_c

Any idea why?

Annotation 2020-07-01 112720.jpg

It's on CRYPTOPP_ASSERT(m.NotZero()); line. and I'm new to crypto++. I also tried sing msys2 and it fail also when run this code on the sample

This is the code
#include "cryptopp/cryptlib.h"
#include "cryptopp/sha.h"
#include <iostream>

int main (int argcchar* argv[])
{
    using namespace CryptoPP;

    SHA1 hash;  
    std::cout << "Name: " << hash.AlgorithmName() << std::endl;
    std::cout << "Digest size: " << hash.DigestSize() << std::endl;
    std::cout << "Block size: " << hash.BlockSize() << std::endl;

    return 0
}

Any Idea? Thank you

Jeffrey Walton

unread,
Jul 2, 2020, 8:22:08 PM7/2/20
to Crypto++ Users


On Wednesday, July 1, 2020 at 12:29:20 AM UTC-4, Benyamin Limanto wrote:
Hello I tried to run the test operation on VS 2017 and got error
Testing Integer operations...

Assertion failed: d:\users\ben\my desktop\crypto\cryptopp\integer.cpp(4408): CryptoPP::a_times_b_mod_c

Any idea why?

Annotation 2020-07-01 112720.jpg

It's on CRYPTOPP_ASSERT(m.NotZero()); line. and I'm new to crypto++. I also tried sing msys2 and it fail also when run this code on the sample


You are running cryptest.exe in a debug build. That's the reason assertions are present in general.

The reason for this particular assertion is https://github.com/weidai11/cryptopp/blob/master/validat2.cpp#L1150, and the mod 0 tests. The library will throw an Integer::DivideByZero exception, and that's what is being tested.

The assertion that proceeds the throw is intended to help you debug your program. It will be present in our test program and your real programs because of the debug build.

The assertion will not fire in the sample program you provided.

Jeff

Reply all
Reply to author
Forward
0 new messages