/[emacs]/emacs/lisp/gnus/rfc2104.el
ViewVC logotype

Diff of /emacs/lisp/gnus/rfc2104.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pj, Sun Jul 15 17:42:53 2001 UTC revision 1.4 by lektu, Tue Feb 4 13:06:38 2003 UTC
# Line 53  Line 53 
53  ;;; 2000-05-12  added sha-1 example, added test case reference  ;;; 2000-05-12  added sha-1 example, added test case reference
54    
55  ;;; Code:  ;;; Code:
56    
57  (eval-when-compile (require 'cl))  (eval-when-compile (require 'cl))
58    
59  ;; Magic character for inner HMAC round. 0x36 == 54 == '6'  ;; Magic character for inner HMAC round. 0x36 == 54 == '6'
# Line 66  Line 66 
66  (defconst rfc2104-zero ?\x00)  (defconst rfc2104-zero ?\x00)
67    
68  ;; Alist for converting hex to decimal.  ;; Alist for converting hex to decimal.
69  (defconst rfc2104-hex-alist  (defconst rfc2104-hex-alist
70    '((?0 . 0)          (?a . 10)       (?A . 10)    '((?0 . 0)          (?a . 10)       (?A . 10)
71      (?1 . 1)          (?b . 11)       (?B . 11)      (?1 . 1)          (?b . 11)       (?B . 11)
72      (?2 . 2)          (?c . 12)       (?C . 12)      (?2 . 2)          (?c . 12)       (?C . 12)
# Line 95  Line 95 
95    
96  (defun rfc2104-hash (hash block-length hash-length key text)  (defun rfc2104-hash (hash block-length hash-length key text)
97    (let* (;; if key is longer than B, reset it to HASH(key)    (let* (;; if key is longer than B, reset it to HASH(key)
98           (key (if (> (length key) block-length)           (key (if (> (length key) block-length)
99                    (funcall hash key) key))                    (funcall hash key) key))
100           (k_ipad (append key nil))           (k_ipad (append key nil))
101           (k_opad (append key nil)))           (k_opad (append key nil)))

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26