Changeset 34381 in project


Ignore:
Timestamp:
08/26/17 23:28:02 (3 months ago)
Author:
kon
Message:

add raw-update

Location:
release/4/ripemd/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/ripemd/trunk/ripemd.meta

    r31021 r34381  
    99 (depends
    1010        (setup-helper "1.5.2")
    11         (message-digest "3.1.0"))
     11        (message-digest "3.4.0"))
    1212 (test-depends test)
    1313 (files "rmd160.h" "rmd128.h" "rmd160.c" "ripemd.setup" "rmd128.c" "ripemd.meta" "ripemd.scm" "ripemd.release-info" "tests/run.scm") )
  • release/4/ripemd/trunk/ripemd.scm

    r31021 r34381  
    55(module ripemd
    66
    7   (;export
    8     ripemd128-primitive
    9     ripemd160-primitive)
    10 
    11   (import scheme chicken foreign)
    12   (use message-digest-primitive)
     7(;export
     8  ripemd128-primitive
     9  ripemd160-primitive)
     10
     11(import scheme chicken foreign)
     12(use message-digest-primitive)
     13
     14;;;
    1315
    1416#>
     
    133135<#
    134136
    135 ;;
     137;;;
    136138
    137139(define-foreign-variable context-size128 unsigned-int "RMD128ctxsiz")
     
    147149  (foreign-lambda* void ((c-pointer ctx) (scheme-pointer result))
    148150    "ripemdX_final( &MDfinish128, result, ctx, RMD128hshsiz );"))
     151(define raw-update128
     152  (foreign-lambda* void ((c-pointer ctx) (c-pointer obj) (int len))
     153    "ripemdX_update( &compress128, ctx, obj, len );"))
     154
     155(define ripemd128-primitive
     156  (let ((the-prim #f))
     157    (lambda ()
     158      (or the-prim
     159          (begin
     160            (set! the-prim
     161                  (make-message-digest-primitive
     162                    context-size128 digest-length128
     163                    init128 update128 final128
     164                    block-length128 'ripemd128-primitive
     165                    raw-update128))
     166            the-prim ) ) ) ) )
     167
     168;;;
    149169
    150170(define-foreign-variable context-size160 unsigned-int "RMD160ctxsiz")
     
    161181  (foreign-lambda* void ((c-pointer ctx) (scheme-pointer result))
    162182    "ripemdX_final( &MDfinish160, result, ctx, RMD160hshsiz );"))
    163 
    164 ;;
    165 
    166 (define ripemd128-primitive
    167   (let ((the-prim #f))
    168     (lambda ()
    169       (or the-prim
    170           (begin
    171             (set! the-prim
    172                   (make-message-digest-primitive
    173                     context-size128 digest-length128
    174                     init128 update128 final128
    175                     block-length128 'ripemd128-primitive))
    176             the-prim ) ) ) ) )
     183(define raw-update160
     184  (foreign-lambda* void ((c-pointer ctx) (c-pointer obj) (int len))
     185    "ripemdX_update( &compress160, ctx, obj, len );"))
    177186
    178187(define ripemd160-primitive
     
    185194                    context-size160 digest-length160
    186195                    init160 update160 final160
    187                     block-length160 'ripemd160-primitive))
     196                    block-length160 'ripemd160-primitive
     197                    raw-update160))
    188198            the-prim ) ) ) ) )
    189199
  • release/4/ripemd/trunk/ripemd.setup

    r33413 r34381  
    55(verify-extension-name "ripemd")
    66
    7 (setup-shared-extension-module 'ripemd (extension-version "1.1.1")
     7(setup-shared-extension-module 'ripemd (extension-version "1.2.0")
    88  #:compile-options '(
    99    -fixnum-arithmetic
Note: See TracChangeset for help on using the changeset viewer.