Changeset 36252 in project


Ignore:
Timestamp:
08/13/18 05:35:16 (4 months ago)
Author:
kon
Message:

mdp+functor support

Location:
release/5/sha1/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/sha1/trunk/sha1.egg

    r36136 r36252  
    44
    55((synopsis "Computes SHA1 (FIPS-180-1) checksums")
    6  (version "4.0.2")
     6 (version "4.1.0")
    77 (category crypt)
    88 (author "Steve Reid, packaged for Chicken by Peter Bex")
     
    1212 (test-dependencies test message-digest-utils message-digest-type)
    1313 (components
     14  (extension sha1-api
     15    #;(inline-file)
     16    (types-file)
     17    (csc-options "-O3" "-d1" "-local" "-no-procedure-checks") )
     18  (extension sha1-primitive
     19    #;(inline-file)
     20    (types-file)
     21    (component-dependencies sha1-api)
     22    (csc-options "-O3" "-d1" "-local" "-no-procedure-checks") )
    1423  (extension sha1
    1524    #;(inline-file)
    1625    (types-file)
    17     (csc-options "-O3" "-d1") ) ) )
     26    (component-dependencies sha1-primitive)
     27    (csc-options "-O3" "-d1" "-local" "-no-procedure-checks") ) ) )
  • release/5/sha1/trunk/sha1.scm

    r35869 r36252  
    1 ;;
    2 ;; sha1 - Scheme wrapper for Steve Reid's Public Domain sha1 implementation
    3 ;;
    4 ;; All code in this egg is in the Public Domain
     1;;;; sha1.scm  -*- Scheme -*-
     2;;;; Kon Lovett, Jul '18
    53
    6 #>#include "sha1-base.c"<#
     4(module sha1 ()
    75
    8 (module sha1
     6(import scheme (chicken module))
     7(import sha1-primitive)
    98
    10 (;export
    11   sha1-primitive)
     9(reexport sha1-primitive)
    1210
    13 (import scheme
    14   (chicken base)
    15   (chicken foreign)
    16   message-digest-primitive)
    17 
    18 (define-foreign-variable *digest-length* unsigned-int "SHA1_DIGEST_LENGTH")
    19 (define-foreign-variable *block-length* unsigned-int "SHA1_BLOCK_LENGTH")
    20 (define-foreign-variable *context-size* unsigned-int "sizeof(SHA1_CTX)")
    21 
    22 (define init (foreign-lambda void SHA1Init c-pointer))
    23 (define update (foreign-lambda void SHA1Update c-pointer scheme-pointer unsigned-int))
    24 (define final (foreign-lambda void SHA1Final c-pointer scheme-pointer))
    25 (define raw-update (foreign-lambda void SHA1Update c-pointer c-pointer unsigned-int))
    26 
    27 (define sha1-primitive
    28   (let ((the-sha1-primitive #f))
    29     (lambda ()
    30       (unless the-sha1-primitive
    31         (set! the-sha1-primitive (make-message-digest-primitive
    32           *context-size* *digest-length* init update final
    33           #:block-length *block-length* #:raw-update raw-update #:name 'sha1)) )
    34       the-sha1-primitive ) ) )
    35 )
     11) ;sha1
Note: See TracChangeset for help on using the changeset viewer.