From b08ad4699a023ab0f736e073170de92219c598e1 Mon Sep 17 00:00:00 2001
From: Andy Bennett <andyjpb@ashurst.eu.org>
Date: Sun, 20 Jan 2019 22:19:22 +0000
Subject: [PATCH] Port to CHICKEN 5
* New .release-info for releases compatible with CHICKEN 5.
* Provisional 7.2.0 release for CHICKEN 4 and CHICKEN 5.
* Remove the version number from the .setup file. Henrietta will fill it
in automatically and locally (possibly modified) `chicken-install`s will
get "unknown" in `chicken-status`.
Signed-off-by: Andy Bennett <andyjpb@ashurst.eu.org>
---
hmac.release-info | 3 ++-
hmac.release-info.chicken-5 | 4 ++++
hmac.scm | 14 ++++++++++++--
hmac.setup | 3 +--
tests/run.scm | 12 ++++++++++--
5 files changed, 29 insertions(+), 7 deletions(-)
create mode 100644 hmac.release-info.chicken-5
diff --git a/hmac.release-info b/hmac.release-info
index 50c8853..3573fb9 100644
a
|
b
|
|
8 | 8 | (release "6") |
9 | 9 | (release "7") |
10 | 10 | (release "7.0.1") |
11 | | (release "7.1.0") |
12 | | No newline at end of file |
| 11 | (release "7.1.0") |
| 12 | (release "7.2.0") |
diff --git a/hmac.release-info.chicken-5 b/hmac.release-info.chicken-5
new file mode 100644
index 0000000..9070f23
-
|
+
|
|
| 1 | (repo git "git://github.com/ThomasHintz/chicken-scheme-{egg-name}.git") ; optional |
| 2 | |
| 3 | (uri targz "https://github.com/ThomasHintz/chicken-scheme-{egg-name}/tarball/{egg-release}") |
| 4 | (release "7.2.0") |
diff --git a/hmac.scm b/hmac.scm
index e402e2e..b9129dc 100644
a
|
b
|
|
5 | 5 | (module hmac |
6 | 6 | (hmac hmac-primitive) |
7 | 7 | |
8 | | (import scheme chicken srfi-13) |
9 | | (use message-digest-basic message-digest-item message-digest-update-item) |
| 8 | (import scheme) |
| 9 | |
| 10 | (cond-expand |
| 11 | |
| 12 | (chicken-4 |
| 13 | (import chicken srfi-13) |
| 14 | (use message-digest-basic message-digest-item message-digest-update-item)) |
| 15 | |
| 16 | (chicken-5 |
| 17 | (import (chicken base) (chicken bitwise) srfi-13) |
| 18 | (import message-digest-basic message-digest-item message-digest-update-item))) |
| 19 | |
10 | 20 | |
11 | 21 | (define (hmac-primitive key digest-primitive) |
12 | 22 | (let ((block-size (message-digest-primitive-block-length digest-primitive)) |
diff --git a/hmac.setup b/hmac.setup
index 7f7621b..7bc4cfa 100644
a
|
b
|
|
11 | 11 | ; Files to install for your extension: |
12 | 12 | '("hmac.o" "hmac.so" "hmac.import.so") |
13 | 13 | ; Assoc list with properties for your extension: |
14 | | '((version 7.1.0) |
15 | | (static "hmac.o"))) ;; for static linking |
16 | | No newline at end of file |
| 14 | '((static "hmac.o"))) ;; for static linking |
diff --git a/tests/run.scm b/tests/run.scm
index 9e0dd85..57567e2 100644
a
|
b
|
|
2 | 2 | ; email: t@thintz.com |
3 | 3 | ; license: bsd |
4 | 4 | |
5 | | (use test) |
6 | | (use sha1 string-utils hmac) |
| 5 | (cond-expand |
| 6 | |
| 7 | (chicken-4 |
| 8 | (use test) |
| 9 | (use sha1 string-utils hmac)) |
| 10 | |
| 11 | (chicken-5 |
| 12 | (import test) |
| 13 | (import sha1 string-hexadecimal hmac))) |
| 14 | |
7 | 15 | |
8 | 16 | (test-group "RFC2202 test vectors" |
9 | 17 | (define (testv key msg expected) |