~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to fipsalgt.cpp

  • Committer: weidai
  • Date: 2010-06-18 01:52:34 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:485
avoid SecBlock of arrays

Show diffs side-by-side

added added

removed removed

Lines of Context:
746
746
 
747
747
                if (m_algorithm == "RNG")
748
748
                {
749
 
                        key.resize(16);
750
 
                        HexDecoder hexDec(new ArraySink(key, key.size()));
751
 
                        StringSource(m_data["Key1"], true, new Redirector(hexDec));
752
 
                        StringSource(m_data["Key2"], true, new Redirector(hexDec));
 
749
                        key.resize(24);
 
750
                        StringSource(m_data["Key1"] + m_data["Key2"] + m_data["Key3"], true, new HexDecoder(new ArraySink(key, key.size())));
753
751
 
754
752
                        SecByteBlock seed(m_data2[INPUT]), dt(m_data2[IV]), r(8);
755
 
                        X917RNG rng(new DES_EDE2::Encryption(key), seed, dt);
 
753
                        X917RNG rng(new DES_EDE3::Encryption(key, key.size()), seed, dt);
756
754
 
757
755
                        if (m_test == "MCT")
758
756
                        {
1202
1200
        Map2 m_data2;
1203
1201
        int m_count;
1204
1202
 
1205
 
        AutoSeededX917RNG<DES_EDE3> m_rng;
 
1203
        AutoSeededX917RNG<AES> m_rng;
1206
1204
        std::vector<unsigned int> m_compactString;
1207
1205
};
1208
1206