int aes_test()
{
    AES_CBC_Encryption enc;
    AES_CBC_Decryption dec;
    const int bs(TaoCrypt::AES::BLOCK_SIZE);

    byte key[] = "0123456789abcdef   ";  // align
    byte iv[]  = "1234567890abcdef   ";  // align

    enc.SetKey(key, bs, iv);
    dec.SetKey(key, bs, iv);

    enc.Process(cipher, msg, bs);
    dec.Process(plain, cipher, bs);

    if (memcmp(plain, msg, bs))
        return -60;

    const byte verify[] = 
    {
        0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53,
        0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb
    };

    if (memcmp(cipher, verify, bs))
        return -61;

    AES_ECB_Encryption enc2;
    AES_ECB_Decryption dec2;

    enc2.SetKey(key, bs, iv);
    dec2.SetKey(key, bs, iv);

    enc2.Process(cipher, msg, bs);
    dec2.Process(plain, cipher, bs);

    if (memcmp(plain, msg, bs))
        return -62;

    const byte verify2[] = 
    {
        0xd0,0xc9,0xd9,0xc9,0x40,0xe8,0x97,0xb6,
        0xc8,0x8c,0x33,0x3b,0xb5,0x8f,0x85,0xd1
    };

    if (memcmp(cipher, verify2, bs))
        return -63;

    return 0;
}
int aes_test()
{
    AES_CBC_Encryption enc;
    AES_CBC_Decryption dec;
    const int bs(TaoCrypt::AES::BLOCK_SIZE);

    byte key[] = "0123456789abcdef   ";   
    byte iv[]  = "1234567890abcdef   ";   

    enc.SetKey(key, bs, iv);
    dec.SetKey(key, bs, iv);

    enc.Process(cipher, msg, bs);
    dec.Process(plain, cipher, bs);

    if (memcmp(plain, msg, bs))
        return -60;

    const byte verify[] = 
    {
        0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53,
        0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb
    };

    if (memcmp(cipher, verify, bs))
        return -61;

    AES_ECB_Encryption enc2;
    AES_ECB_Decryption dec2;

    enc2.SetKey(key, bs, iv);
    dec2.SetKey(key, bs, iv);

    enc2.Process(cipher, msg, bs);
    dec2.Process(plain, cipher, bs);

    if (memcmp(plain, msg, bs))
        return -62;

    const byte verify2[] = 
    {
        0xd0,0xc9,0xd9,0xc9,0x40,0xe8,0x97,0xb6,
        0xc8,0x8c,0x33,0x3b,0xb5,0x8f,0x85,0xd1
    };

    if (memcmp(cipher, verify2, bs))
        return -63;

    return 0;
}