The md5 Reference Manual

Table of Contents

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

The md5 Reference Manual

This is the md5 Reference Manual, version 2.0.4, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:15:43 2018 GMT+0.


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

1 Introduction

Build Status

This package implements The MD5 Message-Digest Algorithm, as defined in RFC 1321 by R. Rivest, published April 1992.

It was originally written by Pierre R. Mai, with copious input from the cmucl-help mailing-list hosted at cons.org, in November 2001 and has been placed into the public domain. In the meantime various fixes and improvements for other implementations as well as maintenance have been provided by Christophe Rhodes, Alexey Dejneka, Nathan Froyd, Andreas Fuchs, John Desoi, Dmitriy Ivanov, and Kevin M. Rosenberg, and have been reintegrated into this consolidated version by Pierre R. Mai.

WARNING: The MD5 Message-Digest Algorithm has been compromised as a cryptographically secure hash for some time, with known theoretical and practical attacks. Therefore use of this implemenation is only recommended for legacy uses or uses which do not require a cryptographically secure hash. Use one of the newer SHA-2 and SHA-3 secure hash standards, or whatever is currently deemed cryptographically secure for all other uses.

This software is "as is", and has no warranty of any kind. The authors assume no responsibility for the consequences of any use of this software.


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 md5

Maintainer

Pierre R. Mai <pmai@pmsf.de>

Author

Pierre R. Mai <pmai@pmsf.de>

License

Public Domain

Description

The MD5 Message-Digest Algorithm RFC 1321

Version

2.0.4

Dependency

sb-rotate-byte

Source

md5.asd (file)

Component

md5.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 md5.asd

Location

md5.asd

Systems

md5 (system)


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

3.1.2 md5/md5.lisp

Parent

md5 (system)

Location

md5.lisp

Packages

md5

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 md5

Source

md5.lisp (file)

Use List

common-lisp

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


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

5.1.1 Functions

Function: fill-block ()

Convert a complete 64 byte input vector segment into the given 16 word MD5 block. This currently works on (unsigned-byte 8) and character simple-arrays, via the functions ‘fill-block-ub8’ and ‘fill-block-char’ respectively. Note that it will not work correctly on character simple-arrays if ‘char-code-limit’ is greater than 256.

Package

md5

Source

md5.lisp (file)

Function: fill-block-char ()

DEPRECATED: Convert a complete 64 character input string segment starting from ‘offset’ into the given 16 word MD5 block.

Package

md5

Source

md5.lisp (file)

Function: fill-block-ub8 ()

Convert a complete 64 (unsigned-byte 8) input vector segment starting from ‘offset’ into the given 16 word MD5 block.

Package

md5

Source

md5.lisp (file)

Function: finalize-md5-state STATE

If the given md5-state has not already been finalized, finalize it, by processing any remaining input in its buffer, with suitable padding and appended bit-length, as specified by the MD5 standard.

The resulting MD5 message-digest is returned as an array of sixteen (unsigned-byte 8) values. Calling ‘update-md5-state’ after a call to ‘finalize-md5-state’ results in unspecified behaviour.

Package

md5

Source

md5.lisp (file)

Function: initial-md5-regs ()

Create the initial working state of an MD5 run.

Package

md5

Source

md5.lisp (file)

Function: make-md5-state ()
Package

md5

Source

md5.lisp (file)

Function: md5-state-p OBJECT
Package

md5

Source

md5.lisp (file)

Function: md5regs-digest ()

Create the final 16 byte message-digest from the MD5 working state in ‘regs’. Returns a (simple-array (unsigned-byte 8) (16)).

Package

md5

Source

md5.lisp (file)

Function: md5sum-file PATHNAME

Calculate the MD5 message-digest of the file specified by ‘pathname’.

Package

md5

Source

md5.lisp (file)

Function: md5sum-sequence SEQUENCE &key START END

Calculate the MD5 message-digest of data in ‘sequence’, which should be a 1d simple-array with element type (unsigned-byte 8). On CMU CL and SBCL non-simple and non-1d arrays with this element-type are also supported. Use with strings is DEPRECATED, since this will not work correctly on implementations with ‘char-code-limit’ > 256 and ignores character-coding issues. Use md5sum-string instead, or convert to the required (unsigned-byte 8) format through other means before-hand.

Package

md5

Source

md5.lisp (file)

Function: md5sum-stream STREAM

Calculate an MD5 message-digest of the contents of ‘stream’. Its element-type has to be (unsigned-byte 8). Use on character streams is DEPRECATED, as this will not work correctly on implementations with ‘char-code-limit’ > 256 and ignores character coding issues.

Package

md5

Source

md5.lisp (file)

Function: md5sum-string STRING &key EXTERNAL-FORMAT START END

Calculate the MD5 message-digest of the binary representation of ‘string’ (as octets) in the external format specified by ‘external-format’. The boundaries ‘start’ and ‘end’ refer to character positions in the string, not to octets in the resulting binary representation. The permissible external format specifiers are determined by the underlying implementation.

Package

md5

Source

md5.lisp (file)

Function: update-md5-block ()

This is the core part of the MD5 algorithm. It takes a complete 16 word block of input, and updates the working state in A, B, C, and D accordingly.

Package

md5

Source

md5.lisp (file)

Function: update-md5-state STATE SEQUENCE &key START END

Update the given md5-state from ‘sequence’, which is either a simple-string or a simple-array with element-type (unsigned-byte 8), bounded by ‘start’ and ‘end’, which must be numeric bounding-indices. Note that usage on simple-strings is DEPRECATED, since this will not work correctly if ‘char-code-limit’ is more than 256. String input should be converted to (unsigned-byte 8) simple-arrays with external-format conversion routines beforehand.

Package

md5

Source

md5.lisp (file)


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

5.1.2 Structures

Structure: md5-state ()
Package

md5

Source

md5.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: regs
Type

md5:md5-regs

Initform

(md5:initial-md5-regs)

Readers

md5-state-regs (function)

Writers

(setf md5-state-regs) (function)

Slot: amount
Type

(integer 0 *)

Initform

0

Readers

md5-state-amount (function)

Writers

(setf md5-state-amount) (function)

Slot: block
Type

md5::md5-block

Initform

(md5::make-ub32-vector 16)

Readers

md5-state-block (function)

Writers

(setf md5-state-block) (function)

Slot: buffer
Type

(simple-array (unsigned-byte 8) (64))

Initform

(make-array 64 :element-type (quote (unsigned-byte 8)))

Readers

md5-state-buffer (function)

Writers

(setf md5-state-buffer) (function)

Slot: buffer-index
Type

(integer 0 63)

Initform

0

Readers

md5-state-buffer-index (function)

Writers

(setf md5-state-buffer-index) (function)

Slot: finalized-p
Readers

md5-state-finalized-p (function)

Writers

(setf md5-state-finalized-p) (function)


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

5.1.3 Types

Type: md5-regs ()

The working state of the MD5 algorithm, which contains the 4 32-bit registers A, B, C and D.

Package

md5

Source

md5.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Constants

Constant: +buffer-size+

Size of internal buffer to use for ‘md5sum-stream’ and ‘md5sum-file’ operations. This should be a multiple of 64, the MD5 block size.

Package

md5

Source

md5.lisp (file)

Constant: +md5-magic-a+

Initial value of Register A of the MD5 working state.

Package

md5

Source

md5.lisp (file)

Constant: +md5-magic-b+

Initial value of Register B of the MD5 working state.

Package

md5

Source

md5.lisp (file)

Constant: +md5-magic-c+

Initial value of Register C of the MD5 working state.

Package

md5

Source

md5.lisp (file)

Constant: +md5-magic-d+

Initial value of Register D of the MD5 working state.

Package

md5

Source

md5.lisp (file)


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

5.2.2 Special variables

Special Variable: *t*
Package

md5

Source

md5.lisp (file)


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

5.2.3 Macros

Macro: assemble-ub32 A B C D

Assemble an ub32 value from the given (unsigned-byte 8) values, where a is the intended low-order byte and d the high-order byte.

Package

md5

Source

md5.lisp (file)

Macro: make-ub32-vector LENGTH &rest ARGS
Package

md5

Source

md5.lisp (file)

Macro: md5-regs-a REGS
Package

md5

Source

md5.lisp (file)

Macro: md5-regs-b REGS
Package

md5

Source

md5.lisp (file)

Macro: md5-regs-c REGS
Package

md5

Source

md5.lisp (file)

Macro: md5-regs-d REGS
Package

md5

Source

md5.lisp (file)

Macro: ub32-aref VECTOR INDEX
Package

md5

Source

md5.lisp (file)

Macro: with-md5-round (OP BLOCK) &rest CLAUSES
Package

md5

Source

md5.lisp (file)


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

5.2.4 Compiler macros

Compiler Macro: mod32+ A B
Package

md5

Source

md5.lisp (file)


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

5.2.5 Functions

Function: copy-md5-state INSTANCE
Package

md5

Source

md5.lisp (file)

Function: copy-to-buffer ()

Copy a partial segment from input vector ‘from’ starting at ‘from-offset’ and copying ‘count’ elements into the 64 byte buffer starting at ‘buffer-offset’.

Package

md5

Source

md5.lisp (file)

Function: f ()
Package

md5

Source

md5.lisp (file)

Function: g ()
Package

md5

Source

md5.lisp (file)

Function: h ()
Package

md5

Source

md5.lisp (file)

Function: i ()
Package

md5

Source

md5.lisp (file)

Function: md5-state-amount INSTANCE
Function: (setf md5-state-amount) VALUE INSTANCE
Package

md5

Source

md5.lisp (file)

Function: md5-state-block INSTANCE
Package

md5

Source

md5.lisp (file)

Function: md5-state-buffer INSTANCE
Package

md5

Source

md5.lisp (file)

Function: md5-state-buffer-index INSTANCE
Function: (setf md5-state-buffer-index) VALUE INSTANCE
Package

md5

Source

md5.lisp (file)

Function: md5-state-finalized-p INSTANCE
Function: (setf md5-state-finalized-p) VALUE INSTANCE
Package

md5

Source

md5.lisp (file)

Function: md5-state-regs INSTANCE
Package

md5

Source

md5.lisp (file)

Function: mod32+ ()
Package

md5

Source

md5.lisp (file)

Function: rol32 ()
Package

md5

Source

md5.lisp (file)


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

5.2.6 Types

Type: buffer-index ()
Package

md5

Source

md5.lisp (file)

Type: md5-block ()

The basic 16x32-bit word blocks that MD5 operates on.

Package

md5

Source

md5.lisp (file)

Type: ub32 ()

Corresponds to the 32bit quantity word of the MD5 Spec

Package

md5

Source

md5.lisp (file)

Type: ub32-vector LENGTH
Package

md5

Source

md5.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

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

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

M
md5.asd: The md5<dot>asd file
md5/md5.lisp: The md5/md5<dot>lisp file

Jump to:   F   L   M  

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

A.2 Functions

Jump to:   (  
A   C   F   G   H   I   M   R   U   W  
Index Entry  Section

(
(setf md5-state-amount): Internal functions
(setf md5-state-buffer-index): Internal functions
(setf md5-state-finalized-p): Internal functions

A
assemble-ub32: Internal macros

C
Compiler Macro, mod32+: Internal compiler macros
copy-md5-state: Internal functions
copy-to-buffer: Internal functions

F
f: Internal functions
fill-block: Exported functions
fill-block-char: Exported functions
fill-block-ub8: Exported functions
finalize-md5-state: Exported functions
Function, (setf md5-state-amount): Internal functions
Function, (setf md5-state-buffer-index): Internal functions
Function, (setf md5-state-finalized-p): Internal functions
Function, copy-md5-state: Internal functions
Function, copy-to-buffer: Internal functions
Function, f: Internal functions
Function, fill-block: Exported functions
Function, fill-block-char: Exported functions
Function, fill-block-ub8: Exported functions
Function, finalize-md5-state: Exported functions
Function, g: Internal functions
Function, h: Internal functions
Function, i: Internal functions
Function, initial-md5-regs: Exported functions
Function, make-md5-state: Exported functions
Function, md5-state-amount: Internal functions
Function, md5-state-block: Internal functions
Function, md5-state-buffer: Internal functions
Function, md5-state-buffer-index: Internal functions
Function, md5-state-finalized-p: Internal functions
Function, md5-state-p: Exported functions
Function, md5-state-regs: Internal functions
Function, md5regs-digest: Exported functions
Function, md5sum-file: Exported functions
Function, md5sum-sequence: Exported functions
Function, md5sum-stream: Exported functions
Function, md5sum-string: Exported functions
Function, mod32+: Internal functions
Function, rol32: Internal functions
Function, update-md5-block: Exported functions
Function, update-md5-state: Exported functions

G
g: Internal functions

H
h: Internal functions

I
i: Internal functions
initial-md5-regs: Exported functions

M
Macro, assemble-ub32: Internal macros
Macro, make-ub32-vector: Internal macros
Macro, md5-regs-a: Internal macros
Macro, md5-regs-b: Internal macros
Macro, md5-regs-c: Internal macros
Macro, md5-regs-d: Internal macros
Macro, ub32-aref: Internal macros
Macro, with-md5-round: Internal macros
make-md5-state: Exported functions
make-ub32-vector: Internal macros
md5-regs-a: Internal macros
md5-regs-b: Internal macros
md5-regs-c: Internal macros
md5-regs-d: Internal macros
md5-state-amount: Internal functions
md5-state-block: Internal functions
md5-state-buffer: Internal functions
md5-state-buffer-index: Internal functions
md5-state-finalized-p: Internal functions
md5-state-p: Exported functions
md5-state-regs: Internal functions
md5regs-digest: Exported functions
md5sum-file: Exported functions
md5sum-sequence: Exported functions
md5sum-stream: Exported functions
md5sum-string: Exported functions
mod32+: Internal compiler macros
mod32+: Internal functions

R
rol32: Internal functions

U
ub32-aref: Internal macros
update-md5-block: Exported functions
update-md5-state: Exported functions

W
with-md5-round: Internal macros

Jump to:   (  
A   C   F   G   H   I   M   R   U   W  

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

A.3 Variables

Jump to:   *   +  
A   B   C   F   R   S  
Index Entry  Section

*
*t*: Internal special variables

+
+buffer-size+: Internal constants
+md5-magic-a+: Internal constants
+md5-magic-b+: Internal constants
+md5-magic-c+: Internal constants
+md5-magic-d+: Internal constants

A
amount: Exported structures

B
block: Exported structures
buffer: Exported structures
buffer-index: Exported structures

C
Constant, +buffer-size+: Internal constants
Constant, +md5-magic-a+: Internal constants
Constant, +md5-magic-b+: Internal constants
Constant, +md5-magic-c+: Internal constants
Constant, +md5-magic-d+: Internal constants

F
finalized-p: Exported structures

R
regs: Exported structures

S
Slot, amount: Exported structures
Slot, block: Exported structures
Slot, buffer: Exported structures
Slot, buffer-index: Exported structures
Slot, finalized-p: Exported structures
Slot, regs: Exported structures
Special Variable, *t*: Internal special variables

Jump to:   *   +  
A   B   C   F   R   S  

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

A.4 Data types

Jump to:   B   M   P   S   T   U  
Index Entry  Section

B
buffer-index: Internal types

M
md5: The md5 system
md5: The md5 package
md5-block: Internal types
md5-regs: Exported types
md5-state: Exported structures

P
Package, md5: The md5 package

S
Structure, md5-state: Exported structures
System, md5: The md5 system

T
Type, buffer-index: Internal types
Type, md5-block: Internal types
Type, md5-regs: Exported types
Type, ub32: Internal types
Type, ub32-vector: Internal types

U
ub32: Internal types
ub32-vector: Internal types

Jump to:   B   M   P   S   T   U