Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

getRequestNonce() discards 'data' #32

Open
pprindeville opened this issue Aug 5, 2021 · 1 comment
Open

getRequestNonce() discards 'data' #32

pprindeville opened this issue Aug 5, 2021 · 1 comment

Comments

@pprindeville
Copy link

pprindeville commented Aug 5, 2021

Rewriting the description, the first line of the header block states:

Generates a 16-byte nonce with additional data.

but close to the top of the function, we see:

        byte[] bytes = new byte[24];
        mRandom.nextBytes(bytes);
        try {
            byteStream.write(bytes);

so that the nonce is always at least 24 bytes, plus whatever additional data comes in as a parameter. Is the return value meant to be the SHA256 of byteStream? Where is the number "16-byte" coming from?

@lifnn99526
Copy link

Rewriting the description, the first line of the header block states:

Generates a 16-byte nonce with additional data.

but close to the top of the function, we see:

        byte[] bytes = new byte[24];
        mRandom.nextBytes(bytes);
        try {
            byteStream.write(bytes);

so that the nonce is always at least 24 bytes, plus whatever additional data comes in as a parameter. Is the return value meant to be the SHA256 of byteStream? Where is the number "16-byte" coming from?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants