www/js/asmcrypto/asmcrypto.all.js
/**
     * Conventional subtraction
     *
     * @param A offset of the first argument, 32-byte aligned
     * @param lA length of the first argument, multiple of 32
     *
     * @param B offset of the second argument, 32-bit aligned
     * @param lB length of the second argument, multiple of 32
     *
     * @param R offset where to place the result to, 32-byte aligned
     * @param lR length to truncate the result to, multiple of 32
     */
Conventional subtraction
@param A offset of the first argument, 32-byte aligned
@param lA length of the first argument, multiple of 32

@param B offset of the second argument, 32-bit aligned
@param lB length of the second argument, multiple of 32

@param R offset where to place the result to, 32-byte aligned
@param lR length to truncate the result to, multiple of 32
Conventional subtraction @param A offset of the first argument 32 - byte aligned @param lA length of the first argument multiple of 32 @param B offset of the second argument 32 - bit aligned @param lB length of the second argument multiple of 32 @param R offset where to place the result to 32 - byte aligned @param lR length to truncate the result to multiple of 32
function sub ( A, lA, B, lB, R, lR ) {
        A  =  A|0;
        lA = lA|0;
        B  =  B|0;
        lB = lB|0;
        R  =  R|0;
        lR = lR|0;
        var a = 0, b = 0, c = 0, t = 0, r = 0, i = 0;
        if ( (lR|0) <= 0 )
            lR = (lA|0) > (lB|0) ? lA+4|0 : lB+4|0;
        if ( (lR|0) < (lA|0) )
            lA = lR;
        if ( (lR|0) < (lB|0) )
            lB = lR;
        if ( (lA|0) < (lB|0) ) {
            for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {
                a = HEAP32[(A+i)>>2]|0;
                b = HEAP32[(B+i)>>2]|0;
                t = ( (a & 0xffff) - (b & 0xffff)|0 ) + c|0;
                r = ( (a >>> 16) - (b >>> 16)|0 ) + (t >> 16)|0;
                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);
                c = r >> 16;
            }
            for ( ; (i|0) < (lB|0); i = (i+4)|0 ) {
                b = HEAP32[(B+i)>>2]|0;
                t = c - (b & 0xffff)|0;
                r = (t >> 16) - (b >>> 16)|0;
                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);
                c = r >> 16;
            }
        }
        else {
            for ( ; (i|0) < (lB|0); i = (i+4)|0 ) {
                a = HEAP32[(A+i)>>2]|0;
                b = HEAP32[(B+i)>>2]|0;
                t = ( (a & 0xffff) - (b & 0xffff)|0 ) + c|0;
                r = ( (a >>> 16) - (b >>> 16)|0 ) + (t >> 16)|0;
                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);
                c = r >> 16;
            }
            for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {
                a = HEAP32[(A+i)>>2]|0;
                t = (a & 0xffff) + c|0;
                r = (a >>> 16) + (t >> 16)|0;
                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);
                c = r >> 16;
            }
        }
        for ( ; (i|0) < (lR|0); i = (i+4)|0 ) {
            HEAP32[(R+i)>>2] = c|0;
        }
        return c|0;
    }
function sub ( A , lA , B , lB , R , lR ) { A = A | 0 ; lA = lA | 0 ; B = B | 0 ; lB = lB | 0 ; R = R | 0 ; lR = lR | 0 ; var a = 0 , b = 0 , c = 0 , t = 0 , r = 0 , i = 0 ; if ( ( lR | 0 ) <= 0 ) lR = ( lA | 0 ) > ( lB | 0 ) ? lA + 4 | 0 : lB + 4 | 0 ; if ( ( lR | 0 ) < ( lA | 0 ) ) lA = lR ; if ( ( lR | 0 ) < ( lB | 0 ) ) lB = lR ; if ( ( lA | 0 ) < ( lB | 0 ) ) { for ( ; ( i | 0 ) < ( lA | 0 ) ; i = ( i + 4 ) | 0 ) { a = HEAP32 [ ( A + i ) >> 2 ] | 0 ; b = HEAP32 [ ( B + i ) >> 2 ] | 0 ; t = ( ( a & 0xffff ) - ( b & 0xffff ) | 0 ) + c | 0 ; r = ( ( a >>> 16 ) - ( b >>> 16 ) | 0 ) + ( t >> 16 ) | 0 ; HEAP32 [ ( R + i ) >> 2 ] = ( t & 0xffff ) | ( r << 16 ) ; c = r >> 16 ; } for ( ; ( i | 0 ) < ( lB | 0 ) ; i = ( i + 4 ) | 0 ) { b = HEAP32 [ ( B + i ) >> 2 ] | 0 ; t = c - ( b & 0xffff ) | 0 ; r = ( t >> 16 ) - ( b >>> 16 ) | 0 ; HEAP32 [ ( R + i ) >> 2 ] = ( t & 0xffff ) | ( r << 16 ) ; c = r >> 16 ; } } else { for ( ; ( i | 0 ) < ( lB | 0 ) ; i = ( i + 4 ) | 0 ) { a = HEAP32 [ ( A + i ) >> 2 ] | 0 ; b = HEAP32 [ ( B + i ) >> 2 ] | 0 ; t = ( ( a & 0xffff ) - ( b & 0xffff ) | 0 ) + c | 0 ; r = ( ( a >>> 16 ) - ( b >>> 16 ) | 0 ) + ( t >> 16 ) | 0 ; HEAP32 [ ( R + i ) >> 2 ] = ( t & 0xffff ) | ( r << 16 ) ; c = r >> 16 ; } for ( ; ( i | 0 ) < ( lA | 0 ) ; i = ( i + 4 ) | 0 ) { a = HEAP32 [ ( A + i ) >> 2 ] | 0 ; t = ( a & 0xffff ) + c | 0 ; r = ( a >>> 16 ) + ( t >> 16 ) | 0 ; HEAP32 [ ( R + i ) >> 2 ] = ( t & 0xffff ) | ( r << 16 ) ; c = r >> 16 ; } } for ( ; ( i | 0 ) < ( lR | 0 ) ; i = ( i + 4 ) | 0 ) { HEAP32 [ ( R + i ) >> 2 ] = c | 0 ; } return c | 0 ; }
Conventional subtraction
 @param A offset of the first argument, 32-byte aligned
 @param lA length of the first argument, multiple of 32
Conventional subtraction @param A offset of the first argument 32 - byte aligned @param lA length of the first argument multiple of 32