Changeset 31016 in project


Ignore:
Timestamp:
06/14/14 20:48:05 (6 years ago)
Author:
Kon Lovett
Message:

add block-length to prim

Location:
release/4/md5
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/md5/tags/3.1.0/md5-base.c

    r23314 r31016  
    1717#include <string.h>     /* for memcpy() */
    1818
     19#define MD5_BLOCK_SIZE 64
     20
    1921struct MD5Context {
    2022        uint32_t buf[4];
    2123        uint32_t bits[2];
    22         unsigned char in[64];
     24        unsigned char in[MD5_BLOCK_SIZE];
    2325};
    2426
     
    2729static void MD5Init(struct MD5Context *context);
    2830static void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len);
    29 static void MD5Final(struct MD5Context *context, unsigned char digest[16]);
     31static void MD5Final(struct MD5Context *context, unsigned char digest[MD5_DIGEST_SIZE]);
    3032static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
    3133
     
    115117
    116118/*
    117  * Final wrapup - pad to 64-byte boundary with the bit pattern 
     119 * Final wrapup - pad to 64-byte boundary with the bit pattern
    118120 * 1 0* (64-bit count of bits processed, MSB-first)
    119121 */
  • release/4/md5/tags/3.1.0/md5.meta

    r26379 r31016  
    77 (doc-from-wiki)
    88 (license "Public Domain")
    9  (depends (message-digest "3.0.0"))
     9 (depends (message-digest "3.1.0"))
    1010 (test-depends test)
    11  (files "md5-base.c" "md5.release-info" "md5.meta" "md5.setup" "tests/run.scm" "md5.scm"))
     11 (files "md5-base.c" "md5.meta" "md5.setup" "tests/run.scm" "md5.scm"))
  • release/4/md5/tags/3.1.0/md5.scm

    r26407 r31016  
    1313
    1414(define digest-length (foreign-value "MD5_DIGEST_SIZE" unsigned-int))
     15(define block-length (foreign-value "MD5_BLOCK_SIZE" unsigned-int))
    1516(define context-size (foreign-value "sizeof(struct MD5Context)" unsigned-int))
    1617
     
    2526        (set! the-md5-primitive
    2627              (make-message-digest-primitive context-size digest-length
    27                                              init update final 'md5-primitive)) )
     28                                             init update final
     29                                             block-length 'md5-primitive)) )
    2830      the-md5-primitive ) ) )
    2931)
  • release/4/md5/tags/3.1.0/md5.setup

    r26407 r31016  
    55  'md5
    66  '("md5.so" "md5.import.so")
    7   `((version "3.0.0")))
     7  `((version "3.1.0")))
  • release/4/md5/trunk/md5-base.c

    r23314 r31016  
    1717#include <string.h>     /* for memcpy() */
    1818
     19#define MD5_BLOCK_SIZE 64
     20
    1921struct MD5Context {
    2022        uint32_t buf[4];
    2123        uint32_t bits[2];
    22         unsigned char in[64];
     24        unsigned char in[MD5_BLOCK_SIZE];
    2325};
    2426
     
    2729static void MD5Init(struct MD5Context *context);
    2830static void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len);
    29 static void MD5Final(struct MD5Context *context, unsigned char digest[16]);
     31static void MD5Final(struct MD5Context *context, unsigned char digest[MD5_DIGEST_SIZE]);
    3032static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
    3133
     
    115117
    116118/*
    117  * Final wrapup - pad to 64-byte boundary with the bit pattern 
     119 * Final wrapup - pad to 64-byte boundary with the bit pattern
    118120 * 1 0* (64-bit count of bits processed, MSB-first)
    119121 */
  • release/4/md5/trunk/md5.meta

    r26379 r31016  
    77 (doc-from-wiki)
    88 (license "Public Domain")
    9  (depends (message-digest "3.0.0"))
     9 (depends (message-digest "3.1.0"))
    1010 (test-depends test)
    11  (files "md5-base.c" "md5.release-info" "md5.meta" "md5.setup" "tests/run.scm" "md5.scm"))
     11 (files "md5-base.c" "md5.meta" "md5.setup" "tests/run.scm" "md5.scm"))
  • release/4/md5/trunk/md5.scm

    r26407 r31016  
    1313
    1414(define digest-length (foreign-value "MD5_DIGEST_SIZE" unsigned-int))
     15(define block-length (foreign-value "MD5_BLOCK_SIZE" unsigned-int))
    1516(define context-size (foreign-value "sizeof(struct MD5Context)" unsigned-int))
    1617
     
    2526        (set! the-md5-primitive
    2627              (make-message-digest-primitive context-size digest-length
    27                                              init update final 'md5-primitive)) )
     28                                             init update final
     29                                             block-length 'md5-primitive)) )
    2830      the-md5-primitive ) ) )
    2931)
  • release/4/md5/trunk/md5.setup

    r26407 r31016  
    55  'md5
    66  '("md5.so" "md5.import.so")
    7   `((version "3.0.0")))
     7  `((version "3.1.0")))
Note: See TracChangeset for help on using the changeset viewer.