VirtualBox

Ignore:
Timestamp:
Jun 29, 2011 4:01:23 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72549
Message:

recompiler: Merged in changes from 0.13.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/tests/sha1.c

    r37675 r37689  
    2424#include <stdio.h>
    2525#include <string.h>
    26 #include <sys/types.h>  /* for u_int*_t */
     26#include <stdint.h>
    2727
    2828/* ================ sha1.h ================ */
     
    3434
    3535typedef struct {
    36     u_int32_t state[5];
    37     u_int32_t count[2];
     36    uint32_t state[5];
     37    uint32_t count[2];
    3838    unsigned char buffer[64];
    3939} SHA1_CTX;
    4040
    41 void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]);
     41void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
    4242void SHA1Init(SHA1_CTX* context);
    43 void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len);
     43void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len);
    4444void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
    4545/* ================ end of sha1.h ================ */
     
    7171/* Hash a single 512-bit block. This is the core of the algorithm. */
    7272
    73 void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64])
    74 {
    75 u_int32_t a, b, c, d, e;
     73void SHA1Transform(uint32_t state[5], const unsigned char buffer[64])
     74{
     75uint32_t a, b, c, d, e;
    7676typedef union {
    7777    unsigned char c[64];
    78     u_int32_t l[16];
     78    uint32_t l[16];
    7979} CHAR64LONG16;
    8080#ifdef SHA1HANDSOFF
     
    146146/* Run your data through this. */
    147147
    148 void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len)
    149 {
    150 u_int32_t i;
    151 u_int32_t j;
     148void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len)
     149{
     150uint32_t i;
     151uint32_t j;
    152152
    153153    j = context->count[0];
     
    187187    for (i = 0; i < 2; i++)
    188188    {
    189         u_int32_t t = context->count[i];
     189        uint32_t t = context->count[i];
    190190        int j;
    191191
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette