Main Page | Packages | Class Tree | Index | Help

xp.util

class MD5Mac

Object
  |
  +--xp.util.MD5Mac


class MD5Mac
extends Object

MD5


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

static
hex_chr
Convert a 32-bit number to a hex string with ls-byte first

Method Summary

static
addme ( x, y )
Add integers, wrapping at 2^32. This uses 16-bit operations internally to work around bugs in some AS interpreters. (Mac Flash!)

static
bitAND ( a, b )
bitwise AND for 32-bit integers. This uses 31 + 1-bit operations internally to work around bug in some AS interpreters. (Mac Flash!)

static
bitOR ( a, b )
somehow the expression (bitAND(b, c) | bitAND((~b), d)) didn't return coorect results on Mac for: b&c = a8a20450, ((~b)&d) = 0101c88b, (bitAND(b, c) | bitAND((~b), d)) = a8a20450 looks like the OR is not executed at all. let's try to trick the P-code compiler into working with us... Prayer beads are GO!

static
bitXOR ( a, b )
will bitXOR be the only one working...? Nope. XOR fails too if values with bit31 set are XORed. Note however that OR (and AND and XOR?!) works alright for the statement (msb31 << 1) | lsb even if the result of the left-shift operation has bit 31 set. So there might be an extra condition here (Guessmode turned on): Mac Flash fails (OR, AND and XOR) if either one of the input operands has bit31 set *and* both operands have one or more bits both set to 1. In other words: when both input bit-patterns 'overlap'. Stuff to munch on for the MM guys, I guess...

public static
calcMD5 ( str )
Take a string and return the hex representation of its MD5.

static
cmn ( q, a, b, x, s, t )
These static functions implement the basic operation for each round of the algorithm.

static
ff ( a, b, c, d, x, s, t )


static
gg ( a, b, c, d, x, s, t )


static
hh ( a, b, c, d, x, s, t )


static
ii ( a, b, c, d, x, s, t )


static
rhex ( num )


static
rol ( num, cnt )
Bitwise rotate a 32-bit number to the left

static
str2blks_MD5 ( str )
Convert a string to a sequence of 16-word blocks, stored as an array. Append padding bits and the length, as described in the MD5 standard.



Field Documentation

hex_chr

static var hex_chr
Convert a 32-bit number to a hex string with ls-byte first


Method Documentation

addme

static function addme(x,
 y)
Add integers, wrapping at 2^32. This uses 16-bit operations internally to work around bugs in some AS interpreters. (Mac Flash!)

bitAND

static function bitAND(a,
 b)
bitwise AND for 32-bit integers. This uses 31 + 1-bit operations internally to work around bug in some AS interpreters. (Mac Flash!)

bitOR

static function bitOR(a,
 b)
somehow the expression (bitAND(b, c) | bitAND((~b), d)) didn't return coorect results on Mac for: b&c = a8a20450, ((~b)&d) = 0101c88b, (bitAND(b, c) | bitAND((~b), d)) = a8a20450 looks like the OR is not executed at all. let's try to trick the P-code compiler into working with us... Prayer beads are GO!

bitXOR

static function bitXOR(a,
 b)
will bitXOR be the only one working...? Nope. XOR fails too if values with bit31 set are XORed. Note however that OR (and AND and XOR?!) works alright for the statement (msb31 << 1) | lsb even if the result of the left-shift operation has bit 31 set. So there might be an extra condition here (Guessmode turned on): Mac Flash fails (OR, AND and XOR) if either one of the input operands has bit31 set *and* both operands have one or more bits both set to 1. In other words: when both input bit-patterns 'overlap'. Stuff to munch on for the MM guys, I guess...

calcMD5

public static function calcMD5(str)
Take a string and return the hex representation of its MD5.

cmn

static function cmn(q,
 a,
 b,
 x,
 s,
 t)
These static functions implement the basic operation for each round of the algorithm.

ff

static function ff(a,
 b,
 c,
 d,
 x,
 s,
 t)

gg

static function gg(a,
 b,
 c,
 d,
 x,
 s,
 t)

hh

static function hh(a,
 b,
 c,
 d,
 x,
 s,
 t)

ii

static function ii(a,
 b,
 c,
 d,
 x,
 s,
 t)

rhex

static function rhex(num)

rol

static function rol(num,
 cnt)
Bitwise rotate a 32-bit number to the left

str2blks_MD5

static function str2blks_MD5(str)
Convert a string to a sequence of 16-word blocks, stored as an array. Append padding bits and the length, as described in the MD5 standard.


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc