comparison src/headers/tomcrypt_cipher.h @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05

Import of libtomcrypt 1.05
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jul 2005 03:53:40 +0000
parents 1c15b283127b
children
comparison
equal deleted inserted replaced
191:1c15b283127b 209:39d5d58461d6
30 }; 30 };
31 #endif 31 #endif
32 32
33 #ifdef RIJNDAEL 33 #ifdef RIJNDAEL
34 struct rijndael_key { 34 struct rijndael_key {
35 ulong32 eK[64], dK[64]; 35 ulong32 eK[60], dK[60];
36 int Nr; 36 int Nr;
37 }; 37 };
38 #endif 38 #endif
39 39
40 #ifdef XTEA 40 #ifdef XTEA
597 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc); 597 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc);
598 int cbc_done(symmetric_CBC *cbc); 598 int cbc_done(symmetric_CBC *cbc);
599 #endif 599 #endif
600 600
601 #ifdef CTR 601 #ifdef CTR
602 int ctr_start(int cipher, const unsigned char *IV, const unsigned char *key, 602
603 int keylen, int num_rounds, symmetric_CTR *ctr); 603 #define CTR_COUNTER_LITTLE_ENDIAN 0
604 #define CTR_COUNTER_BIG_ENDIAN 1
605
606 int ctr_start( int cipher,
607 const unsigned char *IV,
608 const unsigned char *key, int keylen,
609 int num_rounds, int ctr_mode,
610 symmetric_CTR *ctr);
604 int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CTR *ctr); 611 int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CTR *ctr);
605 int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CTR *ctr); 612 int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CTR *ctr);
606 int ctr_getiv(unsigned char *IV, unsigned long *len, symmetric_CTR *ctr); 613 int ctr_getiv(unsigned char *IV, unsigned long *len, symmetric_CTR *ctr);
607 int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr); 614 int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr);
608 int ctr_done(symmetric_CTR *ctr); 615 int ctr_done(symmetric_CTR *ctr);
609 #endif 616 #endif
610 617
611 int find_cipher(const char *name); 618 int find_cipher(const char *name);
612 int find_cipher_any(const char *name, int blocklen, int keylen); 619 int find_cipher_any(const char *name, int blocklen, int keylen);
613 int find_cipher_id(unsigned char ID); 620 int find_cipher_id(unsigned char ID);
614
615 int register_cipher(const struct ltc_cipher_descriptor *cipher); 621 int register_cipher(const struct ltc_cipher_descriptor *cipher);
616 int unregister_cipher(const struct ltc_cipher_descriptor *cipher); 622 int unregister_cipher(const struct ltc_cipher_descriptor *cipher);
617
618 int cipher_is_valid(int idx); 623 int cipher_is_valid(int idx);
619 624
625 LTC_MUTEX_PROTO(ltc_cipher_mutex);
626
627 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cipher.h,v $ */
628 /* $Revision: 1.16 $ */
629 /* $Date: 2005/06/19 18:00:28 $ */