Mercurial > dropbear
comparison src/modes/ctr/ctr_encrypt.c @ 210:4768b55c5240 libtomcrypt
propagate from branch 'au.asn.ucc.matt.ltc-orig' (head 33c416b902f1a44913d825bae7ad9a160f703ed3)
to branch 'au.asn.ucc.matt.dropbear.ltc' (head 4d6aec6e6121e13f68c11c149b6579c41cb63e74)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 06 Jul 2005 12:10:23 +0000 |
parents | 39d5d58461d6 |
children |
comparison
equal
deleted
inserted
replaced
199:8be64e2c86f4 | 210:4768b55c5240 |
---|---|
58 | 58 |
59 while (len) { | 59 while (len) { |
60 /* is the pad empty? */ | 60 /* is the pad empty? */ |
61 if (ctr->padlen == ctr->blocklen) { | 61 if (ctr->padlen == ctr->blocklen) { |
62 /* increment counter */ | 62 /* increment counter */ |
63 if (ctr->mode == 0) { | 63 if (ctr->mode == CTR_COUNTER_LITTLE_ENDIAN) { |
64 /* little-endian */ | 64 /* little-endian */ |
65 for (x = 0; x < ctr->blocklen; x++) { | 65 for (x = 0; x < ctr->blocklen; x++) { |
66 ctr->ctr[x] = (ctr->ctr[x] + (unsigned char)1) & (unsigned char)255; | 66 ctr->ctr[x] = (ctr->ctr[x] + (unsigned char)1) & (unsigned char)255; |
67 if (ctr->ctr[x] != (unsigned char)0) { | 67 if (ctr->ctr[x] != (unsigned char)0) { |
68 break; | 68 break; |
100 } | 100 } |
101 return CRYPT_OK; | 101 return CRYPT_OK; |
102 } | 102 } |
103 | 103 |
104 #endif | 104 #endif |
105 | |
106 /* $Source: /cvs/libtom/libtomcrypt/src/modes/ctr/ctr_encrypt.c,v $ */ | |
107 /* $Revision: 1.13 $ */ | |
108 /* $Date: 2005/05/05 14:35:59 $ */ |