Commit Graph

45 Commits

Author SHA1 Message Date
Michael Muré
58ebd20b04 feat: rename Discriminant to Algorithm 2025-08-05 15:41:30 +02:00
Michael Muré
68e0d91f64 feat(doc): add some basic examples 2025-08-05 15:36:36 +02:00
Michael Muré
8c8da51656 Expose the hash on all varsig v1.0.0-pre6 2025-07-29 15:22:15 +02:00
Michael Muré
af0845c832 Remove support for varsig v0 2025-07-28 20:41:02 +02:00
Michael Muré
35ef54f79f feat: turns out, PayloadEncoding can be multiple values for EIP191 v1.0.0-pre5 2025-07-24 16:52:58 +02:00
Michael Muré
2f22cb9b15 feat(test): add more tests for the presets, and compat with iso-ucan 2025-07-24 16:52:58 +02:00
Michael Muré
a43c3af4c8 feat(ecdsa): implement varsig for EdDSA 2025-07-22 14:24:39 +02:00
Michael Muré
eab24207bc fix(eddsa): ed25519 or ed448 should be curves, not discriminator 2025-07-22 13:57:22 +02:00
Michael Muré
be01529d44 perf: pre-allocate the buffer when encoding a varsig 2025-07-22 13:10:12 +02:00
Michael Muré
182036b055 fix(eddsa): fix the size of the signature check for ed448 2025-07-22 12:04:31 +02:00
Michael Muré
0763d6f8b6 feat(hashes): shorten HashAlgorithm to Hash, add more of them 2025-07-22 12:03:56 +02:00
Michael Muré
c7a870e9db readme: add authorship and license 2025-07-11 07:28:42 +02:00
Steve Moyer
2238f3a26c build: run GitHub checks only once 2025-07-10 10:47:33 -04:00
Steve Moyer
f2cd448a11 build: support Go v1.23.10 downstream 2025-07-10 10:10:35 -04:00
Steve Moyer
25d4579b29 test(ucan): add test for updated UCAN example varsig v1.0.0-pre4 2025-07-10 06:46:07 -04:00
Michael Muré
5fb3516d15 feat(deps): remove the multicodec dependency, as varsig constants are not multicodec 2025-07-10 12:39:27 +02:00
Michael Muré
eb70826a70 varsig: handle unknown version with an error 2025-07-09 13:39:09 +02:00
Michael Muré
6308c66ab7 update varsig documentation 2025-07-09 13:39:09 +02:00
Steve Moyer
f6b72f1907 fix(v0): restores validateSig behavior 2025-07-09 13:39:09 +02:00
Michael Muré
03770e0d38 use value receiver, remove unneeded generic 2025-07-09 13:39:09 +02:00
Steve Moyer
1ea8b00efd Merge pull request #1 from ucan-wg/constants-alloc
perf(constants): avoid allocating a map for each Decode*() call
2025-07-08 11:53:19 -04:00
Steve Moyer
21a78a9d2d fix(eddsa): use DecodeHashAlgorithm and create decodeEdDSACurve 2025-07-08 11:27:18 -04:00
Michael Muré
5cea53af26 perf(constants): avoid allocating a map for each Decode*() call
```
goos: linux
goarch: amd64
pkg: github.com/ucan-wg/go-varsig
cpu: 13th Gen Intel(R) Core(TM) i7-1360P
                         │    old.txt    │               new.txt                │
                         │    sec/op     │    sec/op     vs base                │
DecodeHashAlgorithm-16     145.65n ± 10%   59.62n ± 30%  -59.07% (p=0.000 n=10)
DecodePayloadEncoding-16   136.65n ± 46%   50.02n ±  5%  -63.40% (p=0.000 n=10)
geomean                     141.1n         54.60n        -61.29%

                         │  old.txt   │               new.txt               │
                         │    B/op    │    B/op     vs base                 │
DecodeHashAlgorithm-16     48.00 ± 0%   48.00 ± 0%       ~ (p=1.000 n=10) ¹
DecodePayloadEncoding-16   48.00 ± 0%   48.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    48.00        48.00       +0.00%
¹ all samples are equal

                         │  old.txt   │               new.txt               │
                         │ allocs/op  │ allocs/op   vs base                 │
DecodeHashAlgorithm-16     1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
DecodePayloadEncoding-16   1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    1.000        1.000       +0.00%
¹ all samples are equal
```
2025-07-08 16:53:40 +02:00
Steve Moyer
8dcaefbf3a feat: switch to dual Apache/MIT licenses 2025-07-08 10:51:45 -04:00
Steve Moyer
caaa0204b8 fix(hash): HashAlgorithmUnspecified should not be ok 2025-07-08 09:42:09 -04:00
Steve Moyer
8c932e0eb8 chore(ownership): transfer ownership from selesy to ucan-wg v1.0.0-pre3 2025-07-08 08:23:30 -04:00
Steve Moyer
83227f36a7 docs: refine Go docs and improve naming v1.0.0-pre2 2025-07-08 07:34:57 -04:00
Steve Moyer
af00c4ff6c fix(ecdsa): add stub to make checks pass on Github v1.0.0-pre1 2025-07-07 16:29:30 -04:00
Steve Moyer
77e0cddcfc build(pre-commit): use pre-commit hooks and configuration as checks 2025-07-07 16:13:58 -04:00
Steve Moyer
03bcfb7b16 feat(eddsa): add support for EdDSA varsigs - and common Ed25519 and Ed448 algorithms 2025-07-07 15:42:11 -04:00
Steve Moyer
8b710b7e23 feat(rsa): adds RSA varsig implementation and "common" algorithms 2025-07-07 11:25:58 -04:00
Steve Moyer
f9f39d363f fix(varsig): make generic and name decode everywhere 2025-07-07 08:55:43 -04:00
Steve Moyer
9c83def9e0 feat(constant): add types/decoders for hash algorithms and payload encoding 2025-07-07 07:36:01 -04:00
Steve Moyer
df4386d185 refactor(varsig): separates payload encoding and signature validation 2025-07-07 07:34:17 -04:00
Steve Moyer
d43079c7fd Merge branch 'main' of github.com:selesy/go-varsig 2025-07-04 11:07:38 -04:00
Steve Moyer
260fc2bf8b docs: add Apache 2.0 LICENSE file 2025-07-04 11:07:27 -04:00
Steve Moyer
109ccc0146 feat(option): add Option type for Varsig construction (initially for varsig < v1) 2025-07-04 10:53:49 -04:00
Steve Moyer
9a6776698a doc(error): document possible varsig encoding/decoding errors 2025-07-04 10:27:12 -04:00
Steve Moyer
d3378a0608 feat(registry): adds default and custom registries for signing algorithms parsing 2025-07-04 10:04:40 -04:00
Steve Moyer
6d514d0061 build: update Go to v1.24.4 and update build tools 2025-07-04 09:40:18 -04:00
Steve Moyer
ba0e92dcee build: configure Go tools and dependencies 2024-11-30 07:55:59 -05:00
Steve Moyer
9565d56178 docs: moves library documentation to Go package doc. 2024-11-29 09:08:28 -05:00
Steve Moyer
9e9cc6dc92 docs: add initial README file 2024-11-29 08:21:26 -05:00
Steve Moyer
7b31ac0149 build: ignore Go, direnv and dotenv files 2024-11-29 07:52:29 -05:00
Steve Moyer
c267fe9169 build: add asdf .tool-versions file 2024-11-29 07:50:01 -05:00