mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
- Fixed some typos in sha-native.scm - Removed unnecessary structs and unions from sha_context - Used more efficient implementation of hex32 - Made (scheme base) a common import in (chibi crypto sha2)
23 lines
644 B
Scheme
23 lines
644 B
Scheme
|
|
(define-library (chibi crypto sha2)
|
|
(import (scheme base))
|
|
(export sha-224 sha-256)
|
|
(cond-expand
|
|
(chibi
|
|
(include "sha2-native.scm")
|
|
(include-shared "crypto"))
|
|
(else
|
|
(import (srfi 33) (chibi bytevector))
|
|
(include "sha2.scm"))))
|
|
|
|
;;> \procedure{(sha-224 src)}
|
|
;;>
|
|
;;> Computes SHA-224 digest of the \var{src} which can be a string,
|
|
;;> a bytevector, or a binary input port. Returns a hexadecimal string
|
|
;;> (in lowercase).
|
|
|
|
;;> \procedure{(sha-256 src)}
|
|
;;>
|
|
;;> Computes SHA-256 digest of the \var{src} which can be a string,
|
|
;;> a bytevector, or a binary input port. Returns a hexadecimal string
|
|
;;> (in lowercase).
|