Changeset 37641 in project


Ignore:
Timestamp:
06/02/19 19:08:52 (3 months ago)
Author:
Kon Lovett
Message:

update len is not size_t but uint32, test not unsafe

Location:
release/5/sha1/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/sha1/trunk/sha1-base.c

    r37640 r37641  
    128128 */
    129129static void
    130 SHA1Update(SHA1_CTX *context, const uint8_t *data, size_t len)
     130SHA1Update(SHA1_CTX *context, const uint8_t *data, uint32_t len)
    131131{
    132     unsigned int i;
     132    uint32_t i;
    133133    uint32_t j;
    134134
     
    163163    for (i = 0; i < 8; i++) {
    164164        finalcount[i] = (uint8_t)((context->count[(i >= 4 ? 0 : 1)]
    165         >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
     165                >> ((3-(i & 3)) * 8) ) & 255);   /* Endian independent */
    166166    }
    167167    SHA1Update(context, (const uint8_t *)"\200", 1);
  • release/5/sha1/trunk/sha1.h

    r35839 r37641  
    1010typedef struct {
    1111        uint32_t state[5];
    12         uint32_t count[2]; 
     12        uint32_t count[2];
    1313        uint8_t buffer[SHA1_BLOCK_LENGTH];
    1414} SHA1_CTX;
    15  
     15
    1616static void     SHA1Transform(uint32_t state[5], const uint8_t buffer[SHA1_BLOCK_LENGTH]);
    1717static void     SHA1Init(SHA1_CTX *context);
    18 static void     SHA1Update(SHA1_CTX *context, const uint8_t *data, size_t len);
     18static void     SHA1Update(SHA1_CTX *context, const uint8_t *data, uint32_t len);
    1919static void     SHA1Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_LENGTH]);
  • release/5/sha1/trunk/tests/run.scm

    r35839 r37641  
    1515(define *csc-options* "-inline-global \
    1616  -specialize -optimize-leaf-routines -clustering -lfa2 \
    17   -local -inline \
    18   -no-trace -no-lambda-info \
    19   -unsafe")
     17  -local -inline")
    2018
    2119(define (test-name #!optional (eggnam EGG-NAME))
Note: See TracChangeset for help on using the changeset viewer.