-#if 0
- {
- SilcCipher twofish;
- unsigned char *src, *dst, *dec;
- SilcBuffer packet;
- int payload_len;
-
- payload_len = 4 + strlen("pekka riikonen");
- packet = silc_buffer_alloc(payload_len);
- silc_buffer_pull_tail(packet, SILC_BUFFER_END(packet));
- silc_buffer_format(packet,
- SILC_STR_UI_SHORT(payload_len),
- SILC_STR_UI_SHORT(SILC_SOCKET_TYPE_CLIENT),
- SILC_STR_UI_XNSTRING("pekka riikonen",
- strlen("pekka riikonen")),
- SILC_STR_END);
-
- silc_cipher_alloc("twofish", &twofish);
- twofish->cipher->set_key(twofish->context, "1234567890123456", 16);
- twofish->set_iv(twofish, "6543210987654321");
- SILC_LOG_HEXDUMP(("source: len %d", packet->len),
- packet->data, packet->len );
- silc_packet_encrypt(twofish, packet, packet->len);
- SILC_LOG_HEXDUMP(("encrypted"), packet->data, packet->len);
- silc_packet_decrypt(twofish, packet, packet->len);
- SILC_LOG_HEXDUMP(("decrypted"), packet->data, packet->len);
-
- }
-
- {
- SilcCipher cipher1, cipher2;
- unsigned char *src, *dst, *dec;
- int len = strlen("12345678901234561234567890123456123456789012345612345678901234561234567890123456");
-
- src = silc_calloc(len + 1, sizeof(unsigned char));
- dst = silc_calloc(len + 1, sizeof(unsigned char));
- dec = silc_calloc(len + 1, sizeof(unsigned char));
-
- memcpy(src, "12345678901234561234567890123456123456789012345612345678901234561234567890123456", len);
-
- silc_cipher_alloc("twofish", &cipher1);
- cipher1->cipher->set_key(cipher1->context, "1234567890123456", 128);
- cipher1->set_iv(cipher1, "6543210987654321");
-
- silc_cipher_alloc("twofish", &cipher2);
- cipher2->cipher->set_key(cipher2->context, "1234567890123456", 128);
- cipher2->set_iv(cipher2, "6543210987654321");
-
- SILC_LOG_HEXDUMP(("source: %d", len), src, len);
- cipher1->cipher->encrypt(cipher1->context, src, src, len, cipher1->iv);
- SILC_LOG_HEXDUMP(("encrypted"), src, len);
- cipher2->set_iv(cipher2, "6543210987654321");
- cipher2->cipher->decrypt(cipher2->context, src, src, len, cipher2->iv);
- SILC_LOG_HEXDUMP(("decrypted"), src, len);
-
- }
-#endif