Skip to content

MLDSAEngine with Null ctx #2199

@xipki

Description

@xipki

In the MLDSAEngine.absorbCtx:

    void absorbCtx(boolean isPreHash, byte[] ctx)
    {
        if (ctx != null)
        {
            shake256Digest.update(isPreHash ? (byte)1 : (byte)0);
            shake256Digest.update((byte)ctx.length);
            shake256Digest.update(ctx, 0, ctx.length);
        }
    }

The computation of M' seems to be different than FIPS 204 which requires the prehash flag byte (0 or 1) and ctx length 0 for empty (null) context.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions