{"size": 991, "ext": "scrbl", "max_stars_repo_path": "doc/utils/rfc/hmac.scrbl", "max_stars_repo_name": "david135/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/utils/rfc/hmac.scrbl", "max_issues_repo_name": "david135/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/utils/rfc/hmac.scrbl", "max_forks_repo_name": "david135/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 36.7037037037, "max_line_length": 83, "alphanum_fraction": 0.7225025227}
@; -*- coding: utf-8 -*-
@subsection[:tag "rfc.hmac"]{(rfc hmac) - HMAC library}

This section describes the HMAC extension of hash algorithm. The HMAC itself
is described @hyperlink[:href "http://tools.ietf.org/html/rfc2104"]{RFC 2104}.
The provided library make user be able to use the algorithm with the APIs of
math library's hash algorithm APIs. For the APIs detail, see
@secref["math.hash"]{Hash operations}.

@define[Library]{@name{(rfc hmac)}}
@desc{Provides HMAC hash algorithm.}

@define[Variable]{@name{HMAC}}
@desc{The name for HMAC hash algorithm.

The following example explains, how to use it.

@codeblock{
(import (rnrs) (rfc hmac) (math))
;; the keyword arguments can be omitted, then it will use an empty bytevector
;; as HMAC key and SHA-1 algorithm as digest algorithm.
(define hmac (hash-algorithm HMAC :key (string->utf8 "hmac key") :hash SHA-1))
(hash hmac (string->utf8 "test"))
;; -> #vu8(57 255 153 118 15 133 255 73 12 199 199 115 185 32 43 225 61 254 159 94)
}
}
