/crypt/ |
A D | md5.c | 77 ctx->total[0] = ctx->total[1] = 0; in md5_init_ctx() 78 ctx->buflen = 0; in md5_init_ctx() 112 ++ctx->total[1]; in md5_finish_ctx() 118 ctx->buffer32[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3); in md5_finish_ctx() 119 ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3) in md5_finish_ctx() 123 __md5_process_block (ctx->buffer, bytes + pad + 8, ctx); in md5_finish_ctx() 217 __md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); in md5_process_bytes() 221 memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], in md5_process_bytes() 222 ctx->buflen); in md5_process_bytes() 265 __md5_process_block (ctx->buffer, 64, ctx); in md5_process_bytes() [all …]
|
A D | sha256.c | 99 ctx->total64 = 0; in __sha256_init_ctx() 100 ctx->buflen = 0; in __sha256_init_ctx() 124 ctx->buffer64[(bytes + pad) / 8] = SWAP64 (ctx->total64 << 3); in __sha256_finish_ctx() 132 __sha256_process_block (ctx->buffer, bytes + pad + 8, ctx); in __sha256_finish_ctx() 157 __sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx); in __sha256_process_bytes() 159 ctx->buflen &= 63; in __sha256_process_bytes() 161 memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], in __sha256_process_bytes() 162 ctx->buflen); in __sha256_process_bytes() 183 __sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); in __sha256_process_bytes() 205 __sha256_process_block (ctx->buffer, 64, ctx); in __sha256_process_bytes() [all …]
|
A D | sha512.c | 120 ctx->total[0] = ctx->total[1] = 0; in __sha512_init_ctx() 121 ctx->buflen = 0; in __sha512_init_ctx() 151 ctx->buffer64[(bytes + pad) / 8] = SWAP ((ctx->total[TOTAL128_high] << 3) in __sha512_finish_ctx() 155 __sha512_process_block (ctx->buffer, bytes + pad + 16, ctx); in __sha512_finish_ctx() 180 __sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx); in __sha512_process_bytes() 182 ctx->buflen &= 127; in __sha512_process_bytes() 184 memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~127], in __sha512_process_bytes() 185 ctx->buflen); in __sha512_process_bytes() 207 ctx); in __sha512_process_bytes() 229 __sha512_process_block (ctx->buffer, 128, ctx); in __sha512_process_bytes() [all …]
|
A D | sha256test.c | 47 struct sha256_ctx ctx; in main() local 54 __sha256_init_ctx (&ctx); in main() 56 &ctx); in main() 57 __sha256_finish_ctx (&ctx, sum); in main() 64 __sha256_init_ctx (&ctx); in main() 67 __sha256_finish_ctx (&ctx, sum); in main() 78 __sha256_init_ctx (&ctx); in main() 81 __sha256_finish_ctx (&ctx, sum); in main() 91 __sha256_init_ctx (&ctx); in main() 93 __sha256_process_bytes (buf, 10, &ctx); in main() [all …]
|
A D | sha512-block.c | 10 uint64_t a = ctx->H[0]; in __sha512_process_block() 11 uint64_t b = ctx->H[1]; in __sha512_process_block() 12 uint64_t c = ctx->H[2]; in __sha512_process_block() 97 ctx->H[0] = a; in __sha512_process_block() 98 ctx->H[1] = b; in __sha512_process_block() 99 ctx->H[2] = c; in __sha512_process_block() 100 ctx->H[3] = d; in __sha512_process_block() 101 ctx->H[4] = e; in __sha512_process_block() 102 ctx->H[5] = f; in __sha512_process_block() 103 ctx->H[6] = g; in __sha512_process_block() [all …]
|
A D | sha512test.c | 66 struct sha512_ctx ctx; in main() local 73 __sha512_init_ctx (&ctx); in main() 75 &ctx); in main() 76 __sha512_finish_ctx (&ctx, sum); in main() 83 __sha512_init_ctx (&ctx); in main() 85 __sha512_process_bytes (&tests[cnt].input[i], 1, &ctx); in main() 86 __sha512_finish_ctx (&ctx, sum); in main() 97 __sha512_init_ctx (&ctx); in main() 99 __sha512_process_bytes (buf, sizeof (buf), &ctx); in main() 100 __sha512_finish_ctx (&ctx, sum); in main()
|
A D | sha256-block.c | 10 uint32_t a = ctx->H[0]; in __sha256_process_block() 11 uint32_t b = ctx->H[1]; in __sha256_process_block() 22 ctx->total64 += len; in __sha256_process_block() 90 ctx->H[0] = a; in __sha256_process_block() 91 ctx->H[1] = b; in __sha256_process_block() 92 ctx->H[2] = c; in __sha256_process_block() 93 ctx->H[3] = d; in __sha256_process_block() 94 ctx->H[4] = e; in __sha256_process_block() 95 ctx->H[5] = f; in __sha256_process_block() 96 ctx->H[6] = g; in __sha256_process_block() [all …]
|
A D | md5test-giant.c | 76 struct md5_ctx ctx; in test_single() local 78 __md5_init_ctx (&ctx); in test_single() 79 __md5_process_bytes (buf, len, &ctx); in test_single() 80 __md5_finish_ctx (&ctx, sum); in test_single() 91 struct md5_ctx ctx; in test_double() local 93 __md5_init_ctx (&ctx); in test_double() 96 __md5_process_bytes (buf, CONST_2G, &ctx); in test_double() 97 __md5_process_bytes (buf + CONST_2G, len - CONST_2G, &ctx); in test_double() 100 __md5_process_bytes (buf, len, &ctx); in test_double() 102 __md5_finish_ctx (&ctx, sum); in test_double()
|
A D | md5test.c | 31 struct md5_ctx ctx; in main() local 40 __md5_init_ctx (&ctx); in main() 41 __md5_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx); in main() 42 __md5_finish_ctx (&ctx, sum); in main() 45 __md5_init_ctx (&ctx); in main() 47 __md5_process_bytes (&tests[cnt].input[i], 1, &ctx); in main() 48 __md5_finish_ctx (&ctx, sum); in main()
|
A D | md5-crypt.c | 154 struct md5_ctx ctx; in __md5_crypt_r() local 159 md5_init_ctx (&ctx, nss_ctx); in __md5_crypt_r() 167 &ctx, nss_ctx); in __md5_crypt_r() 207 &ctx, nss_ctx); in __md5_crypt_r() 210 md5_finish_ctx (&ctx, nss_ctx, alt_result); in __md5_crypt_r() 218 md5_init_ctx (&ctx, nss_ctx); in __md5_crypt_r() 222 md5_process_bytes (key, key_len, &ctx, nss_ctx); in __md5_crypt_r() 232 md5_process_bytes (key, key_len, &ctx, nss_ctx); in __md5_crypt_r() 288 __md5_init_ctx (&ctx); in __md5_crypt_r() 289 __md5_finish_ctx (&ctx, alt_result); in __md5_crypt_r() [all …]
|
A D | md5.h | 99 extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW; 106 struct md5_ctx *ctx) __THROW; 113 struct md5_ctx *ctx) __THROW; 122 extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW; 131 extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
|
A D | sha256-crypt.c | 187 struct sha256_ctx ctx; in __sha256_crypt_r() local 192 sha256_init_ctx (&ctx, nss_ctx); in __sha256_crypt_r() 195 sha256_process_bytes (key, key_len, &ctx, nss_ctx); in __sha256_crypt_r() 233 sha256_finish_ctx (&ctx, nss_ctx, alt_result); in __sha256_crypt_r() 283 sha256_init_ctx (&ctx, nss_ctx); in __sha256_crypt_r() 289 sha256_process_bytes (alt_result, 32, &ctx, nss_ctx); in __sha256_crypt_r() 301 sha256_process_bytes (alt_result, 32, &ctx, nss_ctx); in __sha256_crypt_r() 306 sha256_finish_ctx (&ctx, nss_ctx, alt_result); in __sha256_crypt_r() 371 __sha256_init_ctx (&ctx); in __sha256_crypt_r() 372 __sha256_finish_ctx (&ctx, alt_result); in __sha256_crypt_r() [all …]
|
A D | sha512-crypt.c | 186 struct sha512_ctx ctx; in __sha512_crypt_r() local 191 sha512_init_ctx (&ctx, nss_ctx); in __sha512_crypt_r() 194 sha512_process_bytes (key, key_len, &ctx, nss_ctx); in __sha512_crypt_r() 232 sha512_finish_ctx (&ctx, nss_ctx, alt_result); in __sha512_crypt_r() 282 sha512_init_ctx (&ctx, nss_ctx); in __sha512_crypt_r() 288 sha512_process_bytes (alt_result, 64, &ctx, nss_ctx); in __sha512_crypt_r() 300 sha512_process_bytes (alt_result, 64, &ctx, nss_ctx); in __sha512_crypt_r() 305 sha512_finish_ctx (&ctx, nss_ctx, alt_result); in __sha512_crypt_r() 393 __sha512_init_ctx (&ctx); in __sha512_crypt_r() 394 __sha512_finish_ctx (&ctx, alt_result); in __sha512_crypt_r() [all …]
|
A D | sha256.h | 52 extern void __sha256_init_ctx (struct sha256_ctx *ctx) __THROW; 59 struct sha256_ctx *ctx) __THROW; 66 extern void *__sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
|
A D | sha512.h | 55 extern void __sha512_init_ctx (struct sha512_ctx *ctx) __THROW; 62 struct sha512_ctx *ctx) __THROW; 69 extern void *__sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
|
A D | md5-block.c | 14 __md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) in __md5_process_block() argument 20 md5_uint32 A = ctx->A; in __md5_process_block() 21 md5_uint32 B = ctx->B; in __md5_process_block() 22 md5_uint32 C = ctx->C; in __md5_process_block() 23 md5_uint32 D = ctx->D; in __md5_process_block() 29 ctx->total[0] += lolen; in __md5_process_block() 30 ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen); in __md5_process_block() 162 ctx->A = A; in __md5_process_block() 163 ctx->B = B; in __md5_process_block() 164 ctx->C = C; in __md5_process_block() [all …]
|