Lines Matching defs:cg
418 bool BlockTransformationTest(const CipherFactory &cg, BufferedTransformation &valdata, unsigned int tuples = 0xffff)
421 SecByteBlock plain(cg.BlockSize()), cipher(cg.BlockSize()), out(cg.BlockSize()), outplain(cg.BlockSize());
422 SecByteBlock key(cg.KeyLength());
427 valdata.Get(key, cg.KeyLength());
428 valdata.Get(plain, cg.BlockSize());
429 valdata.Get(cipher, cg.BlockSize());
431 apbt transE = cg.NewEncryption(key);
433 fail = memcmp(out, cipher, cg.BlockSize()) != 0;
435 apbt transD = cg.NewDecryption(key);
437 fail=fail || memcmp(outplain, plain, cg.BlockSize());
442 output.Put(key, cg.KeyLength());
444 output.Put(outplain, cg.BlockSize());
446 output.Put(out, cg.BlockSize());