Changeset 31018 in project


Ignore:
Timestamp:
06/14/14 21:09:28 (6 years ago)
Author:
Kon Lovett
Message:

add block-length to prim, use foreign var instead of const

Location:
release/4/sha1
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/sha1/tags/3.1.0/sha1.meta

    r26380 r31018  
    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)
    1111 (files "sha1.setup" "sha1.scm" "sha1-base.c" "sha1.meta" "sha1.release-info" "tests/run.scm" "sha1.h") )
  • release/4/sha1/tags/3.1.0/sha1.scm

    r26408 r31018  
    1212(foreign-declare "#include \"sha1-base.c\"")
    1313
    14 (define-constant *digest-length* 20)
     14(define-foreign-variable *digest-length* unsigned-int "SHA1_DIGEST_LENGTH")
     15(define-foreign-variable *block-length* unsigned-int "SHA1_BLOCK_LENGTH")
     16(define-foreign-variable *context-size* unsigned-int "sizeof(SHA1_CTX)")
    1517
    16 (define *context-size* (foreign-value "sizeof(SHA1_CTX)" unsigned-int))
     18;(define *context-size* (foreign-value "sizeof(SHA1_CTX)" unsigned-int))
    1719
    1820(define init (foreign-lambda void SHA1Init c-pointer))
     
    2628        (set! the-sha1-primitive
    2729              (make-message-digest-primitive *context-size* *digest-length*
    28                                              init update final 'sha1-primitive)) )
     30                                             init update final
     31                                             *block-length* 'sha1-primitive)) )
    2932      the-sha1-primitive ) ) )
    3033)
  • release/4/sha1/tags/3.1.0/sha1.setup

    r26408 r31018  
    55  'sha1
    66  '("sha1.so" "sha1.import.so")
    7   '((version "3.0.0")))
     7  '((version "3.1.0")))
  • release/4/sha1/trunk/sha1.meta

    r26380 r31018  
    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)
    1111 (files "sha1.setup" "sha1.scm" "sha1-base.c" "sha1.meta" "sha1.release-info" "tests/run.scm" "sha1.h") )
  • release/4/sha1/trunk/sha1.scm

    r26408 r31018  
    1212(foreign-declare "#include \"sha1-base.c\"")
    1313
    14 (define-constant *digest-length* 20)
     14(define-foreign-variable *digest-length* unsigned-int "SHA1_DIGEST_LENGTH")
     15(define-foreign-variable *block-length* unsigned-int "SHA1_BLOCK_LENGTH")
     16(define-foreign-variable *context-size* unsigned-int "sizeof(SHA1_CTX)")
    1517
    16 (define *context-size* (foreign-value "sizeof(SHA1_CTX)" unsigned-int))
     18;(define *context-size* (foreign-value "sizeof(SHA1_CTX)" unsigned-int))
    1719
    1820(define init (foreign-lambda void SHA1Init c-pointer))
     
    2628        (set! the-sha1-primitive
    2729              (make-message-digest-primitive *context-size* *digest-length*
    28                                              init update final 'sha1-primitive)) )
     30                                             init update final
     31                                             *block-length* 'sha1-primitive)) )
    2932      the-sha1-primitive ) ) )
    3033)
  • release/4/sha1/trunk/sha1.setup

    r26408 r31018  
    55  'sha1
    66  '("sha1.so" "sha1.import.so")
    7   '((version "3.0.0")))
     7  '((version "3.1.0")))
Note: See TracChangeset for help on using the changeset viewer.