Skip to content

refactor: Small-field function parameters #709

@Tabaie

Description

@Tabaie

With fields where the whole element fits in one word, there is no upside to passing function arguments by reference. For example func (z *Element) Add(*Element, *Element) *Element is best turned into func (z *Element) Add(Element, Element) *Element.

This would of course cause a divergence in the API for small and large fields and possibly make writing generic code more difficult, but since in any cryptographic application small field elements need to be bunched together, different code needs to be written for the two cases anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions