Lines Matching refs:digest

331 void sha256(const unsigned char *message, unsigned int len, unsigned char *digest)  in sha256()  argument
337 sha256_final(&ctx, digest); in sha256()
392 void sha256_final(sha256_ctx *ctx, unsigned char *digest) in sha256_final() argument
416 UNPACK32(ctx->h[i], &digest[i << 2]); in sha256_final()
419 UNPACK32(ctx->h[0], &digest[ 0]); in sha256_final()
420 UNPACK32(ctx->h[1], &digest[ 4]); in sha256_final()
421 UNPACK32(ctx->h[2], &digest[ 8]); in sha256_final()
422 UNPACK32(ctx->h[3], &digest[12]); in sha256_final()
423 UNPACK32(ctx->h[4], &digest[16]); in sha256_final()
424 UNPACK32(ctx->h[5], &digest[20]); in sha256_final()
425 UNPACK32(ctx->h[6], &digest[24]); in sha256_final()
426 UNPACK32(ctx->h[7], &digest[28]); in sha256_final()
528 unsigned char *digest) in sha512() argument
534 sha512_final(&ctx, digest); in sha512()
589 void sha512_final(sha512_ctx *ctx, unsigned char *digest) in sha512_final() argument
613 UNPACK64(ctx->h[i], &digest[i << 3]); in sha512_final()
616 UNPACK64(ctx->h[0], &digest[ 0]); in sha512_final()
617 UNPACK64(ctx->h[1], &digest[ 8]); in sha512_final()
618 UNPACK64(ctx->h[2], &digest[16]); in sha512_final()
619 UNPACK64(ctx->h[3], &digest[24]); in sha512_final()
620 UNPACK64(ctx->h[4], &digest[32]); in sha512_final()
621 UNPACK64(ctx->h[5], &digest[40]); in sha512_final()
622 UNPACK64(ctx->h[6], &digest[48]); in sha512_final()
623 UNPACK64(ctx->h[7], &digest[56]); in sha512_final()
630 unsigned char *digest) in sha384() argument
636 sha384_final(&ctx, digest); in sha384()
691 void sha384_final(sha384_ctx *ctx, unsigned char *digest) in sha384_final() argument
715 UNPACK64(ctx->h[i], &digest[i << 3]); in sha384_final()
718 UNPACK64(ctx->h[0], &digest[ 0]); in sha384_final()
719 UNPACK64(ctx->h[1], &digest[ 8]); in sha384_final()
720 UNPACK64(ctx->h[2], &digest[16]); in sha384_final()
721 UNPACK64(ctx->h[3], &digest[24]); in sha384_final()
722 UNPACK64(ctx->h[4], &digest[32]); in sha384_final()
723 UNPACK64(ctx->h[5], &digest[40]); in sha384_final()
730 unsigned char *digest) in sha224() argument
736 sha224_final(&ctx, digest); in sha224()
791 void sha224_final(sha224_ctx *ctx, unsigned char *digest) in sha224_final() argument
815 UNPACK32(ctx->h[i], &digest[i << 2]); in sha224_final()
818 UNPACK32(ctx->h[0], &digest[ 0]); in sha224_final()
819 UNPACK32(ctx->h[1], &digest[ 4]); in sha224_final()
820 UNPACK32(ctx->h[2], &digest[ 8]); in sha224_final()
821 UNPACK32(ctx->h[3], &digest[12]); in sha224_final()
822 UNPACK32(ctx->h[4], &digest[16]); in sha224_final()
823 UNPACK32(ctx->h[5], &digest[20]); in sha224_final()
824 UNPACK32(ctx->h[6], &digest[24]); in sha224_final()
835 void test(const char *vector, unsigned char *digest, in test() argument
844 sprintf(output + 2 * i, "%02x", digest[i]); in test()
897 unsigned char digest[SHA512_DIGEST_SIZE]; in main() local
909 sha224((const unsigned char *) message1, strlen(message1), digest); in main()
910 test(vectors[0][0], digest, SHA224_DIGEST_SIZE); in main()
911 sha224((const unsigned char *) message2a, strlen(message2a), digest); in main()
912 test(vectors[0][1], digest, SHA224_DIGEST_SIZE); in main()
913 sha224(message3, message3_len, digest); in main()
914 test(vectors[0][2], digest, SHA224_DIGEST_SIZE); in main()
919 sha256((const unsigned char *) message1, strlen(message1), digest); in main()
920 test(vectors[1][0], digest, SHA256_DIGEST_SIZE); in main()
921 sha256((const unsigned char *) message2a, strlen(message2a), digest); in main()
922 test(vectors[1][1], digest, SHA256_DIGEST_SIZE); in main()
923 sha256(message3, message3_len, digest); in main()
924 test(vectors[1][2], digest, SHA256_DIGEST_SIZE); in main()
929 sha384((const unsigned char *) message1, strlen(message1), digest); in main()
930 test(vectors[2][0], digest, SHA384_DIGEST_SIZE); in main()
931 sha384((const unsigned char *)message2b, strlen(message2b), digest); in main()
932 test(vectors[2][1], digest, SHA384_DIGEST_SIZE); in main()
933 sha384(message3, message3_len, digest); in main()
934 test(vectors[2][2], digest, SHA384_DIGEST_SIZE); in main()
939 sha512((const unsigned char *) message1, strlen(message1), digest); in main()
940 test(vectors[3][0], digest, SHA512_DIGEST_SIZE); in main()
941 sha512((const unsigned char *) message2b, strlen(message2b), digest); in main()
942 test(vectors[3][1], digest, SHA512_DIGEST_SIZE); in main()
943 sha512(message3, message3_len, digest); in main()
944 test(vectors[3][2], digest, SHA512_DIGEST_SIZE); in main()