https://bugs.kde.org/show_bug.cgi?id=385412

--- Comment #17 from Vadim Barkov <vbr...@gmail.com> ---
(In reply to Julian Seward from comment #14)
> Can you tell me briefly what PPNO does?  Specifically, what inputs and
> what outputs (registers and memory) does it have?  Then I can maybe suggest
> an alternative implementation.

There is some pseudocode:

#define gpr0 0
#define gpr1 1

// r1 and r2 are even
void ppno(register r1, register r2) {

    addressOfParameterBlock = valueOf(gpr1)

    switch(valueOf(gpr0)) {
    case 0x0:
        // Query mode, ignore r1 and r2
        // Save 16 bytes to addressOfParameterBlock
        break;

    case 0x3:
        // SHA-512 generate mode, ignore r2 value

        // Read 240 bytes from addressOfParameterBlock
        addressOfResult = valueOf(r1);
        resultLength = valueOf(r1 + 1);

        // Write resultLength bytes to addressOfResult
        // Overwrite some of 240 bytes starting from addressOfParameterBlock
        break;

    case 0x83:
        // SHA-512 seed mode, ignore r1 value

        // Read some of 240 bytes starting from addressOfParameterBlock
        argumentAddress = valueOf(r2);
        argumentLength = valueOf(r2 + 1);

        // Read argumentLength bytes from argumentAddress
        // Write 240 bytes to addressOfParameterBlock
        break;

    default:
        // Specification exception, abort execution.
    }
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to