Changeset 740 for vendor/current/lib/crypto
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/lib/crypto
- Files:
-
- 1 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/crypto/aes.c
r414 r740 113 113 } 114 114 } 115 116 void aes_cfb8_encrypt(const uint8_t *in, uint8_t *out, 117 size_t length, const AES_KEY *key, 118 uint8_t *iv, int forward) 119 { 120 size_t i; 121 122 for (i=0; i < length; i++) { 123 uint8_t tiv[AES_BLOCK_SIZE*2]; 124 125 memcpy(tiv, iv, AES_BLOCK_SIZE); 126 AES_encrypt(iv, iv, key); 127 if (!forward) { 128 tiv[AES_BLOCK_SIZE] = in[i]; 129 } 130 out[i] = in[i] ^ iv[0]; 131 if (forward) { 132 tiv[AES_BLOCK_SIZE] = out[i]; 133 } 134 memcpy(iv, tiv+1, AES_BLOCK_SIZE); 135 } 136 } -
vendor/current/lib/crypto/aes.h
r414 r740 73 73 unsigned char *, int); 74 74 75 void aes_cfb8_encrypt(const uint8_t *in, uint8_t *out, 76 size_t length, const AES_KEY *key, 77 uint8_t *iv, int forward); 78 75 79 #ifdef __cplusplus 76 80 } -
vendor/current/lib/crypto/arcfour.c
r414 r740 20 20 */ 21 21 22 #include " includes.h"22 #include "replace.h" 23 23 #include "../lib/crypto/arcfour.h" 24 24 -
vendor/current/lib/crypto/arcfour.h
r414 r740 1 1 #ifndef ARCFOUR_HEADER_H 2 2 #define ARCFOUR_HEADER_H 3 4 #include "../lib/util/data_blob.h" 3 5 4 6 struct arcfour_state { -
vendor/current/lib/crypto/crc32.c
r414 r740 41 41 */ 42 42 43 #include " includes.h"43 #include "replace.h" 44 44 #include "../lib/crypto/crc32.h" 45 45 -
vendor/current/lib/crypto/hmacmd5.c
r414 r740 23 23 */ 24 24 25 #include " includes.h"25 #include "replace.h" 26 26 #include "../lib/crypto/hmacmd5.h" 27 27 -
vendor/current/lib/crypto/hmacmd5test.c
r414 r740 17 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 18 */ 19 #include "includes.h" 19 #include "replace.h" 20 #include "../lib/util/util.h" 20 21 #include "../lib/crypto/crypto.h" 21 22 -
vendor/current/lib/crypto/hmacsha256.c
r414 r740 27 27 */ 28 28 29 #include " includes.h"29 #include "replace.h" 30 30 #include "../lib/crypto/crypto.h" 31 31 -
vendor/current/lib/crypto/md4.c
r414 r740 18 18 */ 19 19 20 #include " includes.h"20 #include "replace.h" 21 21 #include "../lib/crypto/md4.h" 22 22 -
vendor/current/lib/crypto/md4test.c
r414 r740 18 18 */ 19 19 20 #include "includes.h" 20 #include "replace.h" 21 #include "../lib/util/util.h" 21 22 #include "../lib/crypto/crypto.h" 22 23 … … 26 27 This uses the test values from rfc1320 27 28 */ 28 bool torture_local_crypto_md4(struct torture_context *torture) 29 bool torture_local_crypto_md4(struct torture_context *torture) 29 30 { 30 31 bool ret = true; -
vendor/current/lib/crypto/md5.c
r414 r740 19 19 abartlet@samba.org Jun 2001 */ 20 20 21 #include " includes.h"21 #include "replace.h" 22 22 23 23 #include "md5.h" … … 29 29 * Note: this code is harmless on little-endian machines. 30 30 */ 31 static void byteReverse(uint8_t *buf, u int_t longs)31 static void byteReverse(uint8_t *buf, unsigned int longs) 32 32 { 33 33 uint32_t t; 34 34 do { 35 t = (uint32_t) ((u int_t) buf[3] << 8 | buf[2]) << 16 |36 ((u int_t) buf[1] << 8 | buf[0]);35 t = (uint32_t) ((unsigned int) buf[3] << 8 | buf[2]) << 16 | 36 ((unsigned int) buf[1] << 8 | buf[0]); 37 37 *(uint32_t *) buf = t; 38 38 buf += 4; … … 109 109 _PUBLIC_ void MD5Final(uint8_t digest[16], struct MD5Context *ctx) 110 110 { 111 u int_t count;111 unsigned int count; 112 112 uint8_t *p; 113 113 … … 145 145 byteReverse((uint8_t *) ctx->buf, 4); 146 146 memmove(digest, ctx->buf, 16); 147 memset(ctx, 0, sizeof( ctx)); /* In case it's sensitive */147 memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ 148 148 } 149 149 -
vendor/current/lib/crypto/md5test.c
r414 r740 18 18 */ 19 19 20 #include "includes.h" 20 #include "replace.h" 21 #include "../lib/util/util.h" 21 22 #include "../lib/crypto/crypto.h" 22 23 -
vendor/current/lib/crypto/sha256.c
r414 r740 39 39 */ 40 40 41 #include " includes.h"41 #include "replace.h" 42 42 #include "sha256.h" 43 43
Note:
See TracChangeset
for help on using the changeset viewer.