The sha1 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The sha1 Reference Manual

This is the sha1 Reference Manual, version 1.0, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 16:37:47 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

SHA1 Digest and HMAC for LispWorks

A very simple implementation of SHA1 and HMAC-SHA1 for LispWorks. The code is intended to be easy to follow and is therefore a little slower than it could be.

Quickstart

There are 6 functions exposed in the sha1 package:

(sha1-digest message)            ;=> digest
(sha1-hex message)               ;=> string
(sha1-base64 message)            ;=> string

(hmac-sha1-digest key message)   ;=> digest
(hmac-sha1-hex key message)      ;=> string
(hmac-sha1-base64 key message)   ;=> string

A digest is a list of 20 bytes. The -hex functions will return a hexadecimal string that is equal to the digest. The -base64 functions will return a base64-encoded string of the digest.

They key and message arguments can either be a sequence of bytes or a string (ASCII or UTF-8).

Some examples (from the Wikipedia pages):

CL-USER > (sha1-digest "")
(218 57 163 238 94 107 75 13 50 85 191 239 149 96 24 144 175 216 7 9)

CL-USER > (sha1-hex "The quick brown fox jumps over the lazy dog")
"2FD4E1C67A2D28FCED849EE1BB76E7391B93EB12"

CL-USER > (sha1-base64 "The quick brown fox jumps over the lazy dog")
"L9ThxnotKPzthJ7hu3bnORuT6xI="

CL-USER > (hmac-sha1-hex "key" "The quick brown fox jumps over the lazy dog")
"DE7C9B85B8B78AA6BC8A7A36F70A90701C9DB4D9"

That's it!


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 sha1

Author

Jeffrey Massung

License

Apache 2.0

Description

SHA1 Digest and HMAC for LispWorks.

Version

1.0

Dependency

base64

Source

sha1.asd (file)

Component

sha1.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 sha1.asd

Location

sha1.asd

Systems

sha1 (system)

Packages

sha1-asd


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 sha1/sha1.lisp

Parent

sha1 (system)

Location

sha1.lisp

Packages

sha1

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 sha1-asd

Source

sha1.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 sha1

Source

sha1.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: hmac-sha1-base64 KEY MESSAGE

Return the HMAC-SHA1 base64-encoded digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)

Function: hmac-sha1-digest KEY MESSAGE

Return the HMAC-SHA1 digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)

Function: hmac-sha1-hex KEY MESSAGE

Return the HMAC-SHA1 hex digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)

Function: sha1-base64 MESSAGE

Return the SHA1 base64-encoded digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)

Function: sha1-digest MESSAGE

Return the SHA1 digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)

Function: sha1-hex MESSAGE

Return the SHA1 hex digest for a byte sequence.

Package

sha1

Source

sha1.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: digest SEQ

Create a SHA-1 digest from an adjustable vector containing the message.

Package

sha1

Source

sha1.lisp (file)

Function: hash-digest HH

Convert a 160-bit hash to a 20-byte digest list.

Package

sha1

Source

sha1.lisp (file)

Function: hash-vector SEQ

Convert x to an unsigned-byte vector.

Package

sha1

Source

sha1.lisp (file)

Function: rotate-word W &optional BITS

Rotate a 32-bit word left by bits.

Package

sha1

Source

sha1.lisp (file)

Function: word V CHUNK BYTE

Read a 32-bit, big-endian word from a message chunk.

Package

sha1

Source

sha1.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, sha1.asd: The sha1<dot>asd file
File, Lisp, sha1/sha1.lisp: The sha1/sha1<dot>lisp file

L
Lisp File, sha1.asd: The sha1<dot>asd file
Lisp File, sha1/sha1.lisp: The sha1/sha1<dot>lisp file

S
sha1.asd: The sha1<dot>asd file
sha1/sha1.lisp: The sha1/sha1<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   D   F   H   R   S   W  
Index Entry  Section

D
digest: Internal functions

F
Function, digest: Internal functions
Function, hash-digest: Internal functions
Function, hash-vector: Internal functions
Function, hmac-sha1-base64: Exported functions
Function, hmac-sha1-digest: Exported functions
Function, hmac-sha1-hex: Exported functions
Function, rotate-word: Internal functions
Function, sha1-base64: Exported functions
Function, sha1-digest: Exported functions
Function, sha1-hex: Exported functions
Function, word: Internal functions

H
hash-digest: Internal functions
hash-vector: Internal functions
hmac-sha1-base64: Exported functions
hmac-sha1-digest: Exported functions
hmac-sha1-hex: Exported functions

R
rotate-word: Internal functions

S
sha1-base64: Exported functions
sha1-digest: Exported functions
sha1-hex: Exported functions

W
word: Internal functions

Jump to:   D   F   H   R   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, sha1: The sha1 package
Package, sha1-asd: The sha1-asd package

S
sha1: The sha1 system
sha1: The sha1 package
sha1-asd: The sha1-asd package
System, sha1: The sha1 system

Jump to:   P   S