vlib/x/crypto: add poly1305 message authentication code (mac) in pure v #20752
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is our third attempt to contribute more broadly and usefully to the vlang community. In this pull request, we propose a new module, named
poly1305
, Poly1305 message authentication code (MAC) in pure v to the experimental namespacesvlib/x/crypto
. See poly1305 for more detail.This module was inspired mostly by the go version of the same module, and tries hard to keep up with the go version, but with some slight differences in places and adding some comments to the existing code to make it easier for other developers and community members to learn and read.
The differences includes:
Uint192
structure representing 192 bits unsigned integer, which is fundamentally and functionally the same as in the go version, with its[3]u64
. This can be extended or added tomath.unsigned
if needed. Seecustom.v
for more details.math.unsigned
module, this also serves as a test bed for standard vlib, especially themath.unsigned
module.So, please give us a review, feedback, criticism or suggestions would be greatly appreciated.
thanks to everyone
Update:
New update
usage_test.v
file to test public API ... its address some advices from @spytheman, see.update
of Poly1305 instance, copied and adapted from poly1305_power_on_self_test