1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
13 ECB implementation, start chain, Tom St Denis
20 Initialize a ECB context
21 @param cipher The index of the cipher desired
22 @param key The secret key
23 @param keylen The length of the secret key (octets)
24 @param num_rounds Number of rounds in the cipher desired (0 for default)
25 @param ecb The ECB state to initialize
26 @return CRYPT_OK if successful
28 int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, symmetric_ECB *ecb)
31 LTC_ARGCHK(key != NULL);
32 LTC_ARGCHK(ecb != NULL);
34 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
38 ecb->blocklen = cipher_descriptor[cipher].block_length;
39 return cipher_descriptor[cipher].setup(key, keylen, num_rounds, &ecb->key);
44 /* ref: $Format:%D$ */
45 /* git commit: $Format:%H$ */
46 /* commit time: $Format:%ai$ */