1 ;;; sha1.el --- SHA1 Secure Hash Algorithm.
3 ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc.
5 ;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
6 ;; Keywords: SHA1, FIPS 180-1
8 ;; This file is part of FLIM (Faithful Library about Internet Message).
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or
13 ;; (at your option) any later version.
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; Examples from FIPS PUB 180-1.
28 ;; <URL:http://www.itl.nist.gov/div897/pubs/fip180-1.htm>
31 ;; => a9993e364706816aba3e25717850c26c9cd0d89d
33 ;; (sha1 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")
34 ;; => 84983e441c3bd26ebaae4aa1f95129e5e54670f1
36 ;; (sha1 (make-string 1000000 ?a))
37 ;; => 34aa973cd4c4daa4f61eeb2bdbad27316534016f
41 (defvar sha1-dl-module
44 (subrp (symbol-function 'sha1)))
46 ((fboundp 'dynamic-link)
47 ;; Should we take care of `dynamic-link-path'?
48 (let ((path (expand-file-name "sha1.so" exec-directory)))
49 (if (file-exists-p path)
56 ((and (stringp sha1-dl-module)
57 (file-exists-p sha1-dl-module))