Home | History | Annotate | Download | only in sha2

Lines Matching refs:buffer

339 	bzero(context->buffer, SHA256_BLOCK_LENGTH);
385 W256 = (sha2_word32*)context->buffer;
443 W256 = (sha2_word32*)context->buffer;
531 /* Calculate how much free space is available in the buffer */
535 /* Fill the buffer completely and process it */
536 bcopy(data, &context->buffer[usedspace], freespace);
540 SHA256_Transform(context, (sha2_word32*)context->buffer);
542 /* The buffer is not yet full */
543 bcopy(data, &context->buffer[usedspace], len);
559 bcopy(data, context->buffer, len);
573 /* If no digest buffer is passed, we don't bother doing this: */
582 context->buffer[usedspace++] = 0x80;
586 bzero(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace);
589 bzero(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace);
592 SHA256_Transform(context, (sha2_word32*)context->buffer);
595 bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH);
599 bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH);
602 *context->buffer = 0x80;
605 *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
608 SHA256_Transform(context, (sha2_word32*)context->buffer);
629 char *SHA256_End(SHA256_CTX* context, char buffer[]) {
636 if (buffer != (char*)0) {
640 *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
641 *buffer++ = sha2_hex_digits[*d & 0x0f];
644 *buffer = (char)0;
649 return buffer;
667 bzero(context->buffer, SHA512_BLOCK_LENGTH);
709 sha2_word64 T1, *W512 = (sha2_word64*)context->buffer;
764 sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer;
853 /* Calculate how much free space is available in the buffer */
857 /* Fill the buffer completely and process it */
858 bcopy(data, &context->buffer[usedspace], freespace);
862 SHA512_Transform(context, (sha2_word64*)context->buffer);
864 /* The buffer is not yet full */
865 bcopy(data, &context->buffer[usedspace], len);
881 bcopy(data, context->buffer, len);
899 context->buffer[usedspace++] = 0x80;
903 bzero(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace);
906 bzero(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace);
909 SHA512_Transform(context, (sha2_word64*)context->buffer);
912 bzero(context->buffer, SHA512_BLOCK_LENGTH - 2);
916 bzero(context->buffer, SHA512_SHORT_BLOCK_LENGTH);
919 *context->buffer = 0x80;
922 *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
923 *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
926 SHA512_Transform(context, (sha2_word64*)context->buffer);
935 /* If no digest buffer is passed, we don't bother doing this: */
958 char *SHA512_End(SHA512_CTX* context, char buffer[]) {
965 if (buffer != (char*)0) {
969 *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
970 *buffer++ = sha2_hex_digits[*d & 0x0f];
973 *buffer = (char)0;
978 return buffer;
996 bzero(context->buffer, SHA384_BLOCK_LENGTH);
1010 /* If no digest buffer is passed, we don't bother doing this: */
1033 char *SHA384_End(SHA384_CTX* context, char buffer[]) {
1040 if (buffer != (char*)0) {
1044 *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
1045 *buffer++ = sha2_hex_digits[*d & 0x0f];
1048 *buffer = (char)0;
1053 return buffer;