From 1f3d104460b3ac2eb9c2bd6a4ccd508e91e17bad Mon Sep 17 00:00:00 2001 From: Angelo De Caro Date: Fri, 18 Jul 2025 10:50:20 +0200 Subject: [PATCH 1/4] idemix race checks Signed-off-by: Angelo De Caro --- go.mod | 17 +++--- go.sum | 40 ++++++------- .../identity/idemix/cache/cache_test.go | 24 ++++++++ token/services/identity/idemix/km_test.go | 56 ++++++++++++++++++ .../bls12_381_bbs_gurvy/ca/ca/IssuerPublicKey | 2 + .../bls12_381_bbs_gurvy/ca/ca/IssuerSecretKey | Bin 0 -> 32 bytes .../bls12_381_bbs_gurvy/ca/ca/RevocationKey | 6 ++ .../ca/msp/IssuerPublicKey | 2 + .../ca/msp/RevocationPublicKey | 5 ++ .../idemix/msp/IssuerPublicKey | 2 + .../idemix/msp/RevocationPublicKey | 5 ++ .../idemix/user/SignerConfig | Bin 0 -> 617 bytes .../idemix2/msp/IssuerPublicKey | 2 + .../idemix2/msp/RevocationPublicKey | 5 ++ .../idemix2/user/SignerConfig | Bin 0 -> 615 bytes .../identity/idemix/testdata/generate.go | 4 ++ .../identity/storage/kvs/hashicorp/go.mod | 11 ++-- .../identity/storage/kvs/hashicorp/go.sum | 40 ++++++------- .../services/identity/storage/kvs/tracker.go | 13 +++- 19 files changed, 175 insertions(+), 59 deletions(-) create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerSecretKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/RevocationKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/IssuerPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/RevocationPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/IssuerPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/RevocationPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/user/SignerConfig create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/msp/IssuerPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/msp/RevocationPublicKey create mode 100644 token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/user/SignerConfig diff --git a/go.mod b/go.mod index 685c69fe8d..706a258b34 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/IBM/idemix v0.0.2-0.20250313153527-832db18b9478 github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478 - github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5 github.com/dgraph-io/ristretto/v2 v2.2.0 + github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 github.com/gin-gonic/gin v1.10.0 github.com/gobuffalo/packr/v2 v2.7.1 github.com/hashicorp/go-uuid v1.0.3 @@ -33,7 +33,7 @@ require ( go.opentelemetry.io/otel/trace v1.34.0 go.uber.org/dig v1.18.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.38.0 + golang.org/x/crypto v0.39.0 golang.org/x/sync v0.14.0 google.golang.org/protobuf v1.36.6 gopkg.in/yaml.v2 v2.4.0 @@ -62,7 +62,7 @@ require ( github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.14.3 // indirect + github.com/bits-and-blooms/bitset v1.20.0 // indirect github.com/bytedance/sonic v1.11.6 // indirect github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -75,6 +75,7 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.13.0 // indirect + github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -181,7 +182,6 @@ require ( github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/miracl/conflate v1.3.4 // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect @@ -280,13 +280,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.8.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect - golang.org/x/mod v0.24.0 // indirect + golang.org/x/mod v0.25.0 // indirect golang.org/x/net v0.40.0 // indirect + golang.org/x/oauth2 v0.26.0 // indirect + golang.org/x/sync v0.15.0 // indirect golang.org/x/oauth2 v0.27.0 // indirect golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.25.0 // indirect + golang.org/x/text v0.26.0 // indirect golang.org/x/time v0.8.0 // indirect - golang.org/x/tools v0.31.0 // indirect + golang.org/x/tools v0.33.0 // indirect gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/api v0.215.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect @@ -301,5 +303,4 @@ require ( modernc.org/memory v1.8.0 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect - rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 4cf7c74d48..d50d64d00c 100644 --- a/go.sum +++ b/go.sum @@ -650,8 +650,8 @@ github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20250313153527-832db18b9478 h github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20250313153527-832db18b9478/go.mod h1:k4Q5EYKRnYC6t80ipSCY3G8H4FdcxRa8jjlsJdGfNCY= github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478 h1:Uzmcb4pNb54/fbAjnrZTiJwWV74+twP60N4qBGm4PvU= github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478/go.mod h1:Pi1QIuIZ+1OXIbnYe27vNwJOnSq2WvkHRT/sfweTw8E= -github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5 h1:wfksZZMeYfPeqsXwiotUsbnOqGGpth6t8Ij4tJ/91kw= -github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= +github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 h1:TelnQIceKrhWVmuFnMXyKyq0WUG5zMT6u+7wnRMkcFY= +github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3/go.mod h1:O230ebw6/22B7T4C03b99ZcPtc5XAfBTOp+ZT+xmMCk= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -682,8 +682,8 @@ github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.14.3 h1:Gd2c8lSNf9pKXom5JtD7AaKO8o7fGQ2LtFj1436qilA= -github.com/bits-and-blooms/bitset v1.14.3/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= +github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -728,6 +728,8 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 h1:Om6kYQYDUk5wWbT0t0q6pvyM49i9XZAv9dDrkDA7gjk= github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= +github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo= github.com/cockroachdb/errors v1.12.0/go.mod h1:SvzfYNNBshAVbZ8wzNc/UPK3w1vf0dKDUP41ucAIf7g= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -1004,7 +1006,6 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= -github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1174,8 +1175,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4= +github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -1246,9 +1247,6 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= -github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= @@ -1697,8 +1695,8 @@ golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1762,8 +1760,8 @@ golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1884,8 +1882,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2021,8 +2019,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2108,8 +2106,8 @@ golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= -golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2510,7 +2508,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/token/services/identity/idemix/cache/cache_test.go b/token/services/identity/idemix/cache/cache_test.go index ae7cf526c3..c38d29f1cc 100644 --- a/token/services/identity/idemix/cache/cache_test.go +++ b/token/services/identity/idemix/cache/cache_test.go @@ -8,6 +8,7 @@ package cache import ( "context" + "sync" "testing" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/metrics/disabled" @@ -33,3 +34,26 @@ func TestIdentityCache(t *testing.T) { assert.Equal(t, driver.Identity([]byte("hello world")), identityDescriptor.Identity) assert.Equal(t, []byte("audit"), identityDescriptor.AuditInfo) } + +func TestIdentityCacheForRace(t *testing.T) { + c := NewIdentityCache(func(context.Context, []byte) (driver.Identity, []byte, error) { + return []byte("hello world"), []byte("audit"), nil + }, 10000, nil, NewMetrics(&disabled.Provider{})) + + numRoutines := 4 + wg := sync.WaitGroup{} + wg.Add(numRoutines) + for i := 0; i < numRoutines; i++ { + go func() { + defer wg.Done() + + for i := 0; i < 100; i++ { + id, audit, err := c.Identity(context.Background(), nil) + assert.NoError(t, err) + assert.Equal(t, driver.Identity([]byte("hello world")), id) + assert.Equal(t, []byte("audit"), audit) + } + }() + } + wg.Wait() +} diff --git a/token/services/identity/idemix/km_test.go b/token/services/identity/idemix/km_test.go index 664692fe58..074ed57eda 100644 --- a/token/services/identity/idemix/km_test.go +++ b/token/services/identity/idemix/km_test.go @@ -12,6 +12,7 @@ import ( "fmt" "path/filepath" "strings" + "sync" "testing" idemix2 "github.com/IBM/idemix" @@ -590,6 +591,61 @@ func TestIdentityFromFabricCAWithEidRhNymPolicy(t *testing.T) { assert.NoError(t, verifier.Verify([]byte("hello world!!!"), sigma)) } +func TestKeyManagerForRace(t *testing.T) { + // testKeyManagerForRace(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + testKeyManagerForRace(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) + // testKeyManagerForRace(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) +} + +func testKeyManagerForRace(t *testing.T, configPath string, curveID math.CurveID, aries bool) { + // prepare + kvs, err := kvs2.NewInMemory() + assert.NoError(t, err) + sigService := sig.NewService(sig.NewMultiplexDeserializer(), kvs2.NewIdentityStore(kvs, token.TMSID{Network: "pineapple"})) + config, err := crypto2.NewConfig(configPath) + assert.NoError(t, err) + tracker := kvs2.NewTrackedMemoryFrom(kvs) + keyStore, err := crypto2.NewKeyStore(curveID, tracker) + assert.NoError(t, err) + cryptoProvider, err := crypto2.NewBCCSP(keyStore, curveID, aries) + assert.NoError(t, err) + + // check that version is enforced + config.Version = 0 + _, err = NewKeyManager(config, sigService, types.EidNymRhNym, cryptoProvider) + assert.Error(t, err) + assert.EqualError(t, err, "unsupported protocol version [0]") + config.Version = crypto2.ProtobufProtocolVersionV1 + + // new key manager loaded from file + assert.Empty(t, config.Signer.Ski) + keyManager, err := NewKeyManager(config, sigService, types.EidNymRhNym, cryptoProvider) + assert.NoError(t, err) + assert.NotNil(t, keyManager) + assert.False(t, keyManager.IsRemote()) + assert.True(t, keyManager.Anonymous()) + assert.Equal(t, "alice", keyManager.EnrollmentID()) + assert.Equal(t, IdentityType, keyManager.IdentityType()) + assert.Equal(t, fmt.Sprintf("Idemix KeyManager [%s]", hash.Hashable(keyManager.Ipk).String()), keyManager.String()) + assert.Equal(t, tracker.PutCounter, 1) + assert.Equal(t, tracker.GetCounter, 0) + + numRoutines := 4 + wg := sync.WaitGroup{} + wg.Add(numRoutines) + for i := 0; i < numRoutines; i++ { + go func() { + defer wg.Done() + + for i := 0; i < 10; i++ { + _, _, err := keyManager.Identity(context.Background(), nil) + assert.NoError(t, err) + } + }() + } + wg.Wait() +} + type TypedSignerDeserializer struct { *KeyManager } diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerPublicKey new file mode 100644 index 0000000000..3185be8892 --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerPublicKey @@ -0,0 +1,2 @@ +®híu|“],Ç`ðKénU·ÑÌ>>;·Š,0<¶ +ÑÛw“ô§ÒZ È/@å©1êË^yPŠ]P¢/Sjv^T¯F­~ô„ÜE Û6|béõøž½!l}ÛBLÏJ \ No newline at end of file diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerSecretKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/IssuerSecretKey new file mode 100644 index 0000000000000000000000000000000000000000..6fc55ebdf6ce617cc06247cfdcb87297e16e2d5f GIT binary patch literal 32 ocmWIW`!3PuW_VgvYEd6wJ%ez?gR-(4$6fl3JZfK;+1z6Q0N4HvtpET3 literal 0 HcmV?d00001 diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/RevocationKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/RevocationKey new file mode 100644 index 0000000000..c4f272671e --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/ca/RevocationKey @@ -0,0 +1,6 @@ +-----BEGIN PRIVATE KEY----- +MIGkAgEBBDCjdtjnsIFqZQSYSDefmUULythjfJksh9yUVVW0R/uIpMxyuusMdlOX +nAoKgpUq7KGgBwYFK4EEACKhZANiAATUnWvTso3B/+at7ArXgIXt8Uutq/+Ixaqr +Ftx/3igF91x4ha2hVyPc8zs3wQdqqQz8R6DJ0qEKdG2rgvh/dlkNYWSG0q2jHPyC ++XOnehJUA1e8LC7zui/ybVV6AAlHSaA= +-----END PRIVATE KEY----- diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/IssuerPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/IssuerPublicKey new file mode 100644 index 0000000000..3185be8892 --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/IssuerPublicKey @@ -0,0 +1,2 @@ +®híu|“],Ç`ðKénU·ÑÌ>>;·Š,0<¶ +ÑÛw“ô§ÒZ È/@å©1êË^yPŠ]P¢/Sjv^T¯F­~ô„ÜE Û6|béõøž½!l}ÛBLÏJ \ No newline at end of file diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/RevocationPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/RevocationPublicKey new file mode 100644 index 0000000000..408701c49b --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/ca/msp/RevocationPublicKey @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE1J1r07KNwf/mrewK14CF7fFLrav/iMWq +qxbcf94oBfdceIWtoVcj3PM7N8EHaqkM/EegydKhCnRtq4L4f3ZZDWFkhtKtoxz8 +gvlzp3oSVANXvCwu87ov8m1VegAJR0mg +-----END PUBLIC KEY----- diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/IssuerPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/IssuerPublicKey new file mode 100644 index 0000000000..3185be8892 --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/IssuerPublicKey @@ -0,0 +1,2 @@ +®híu|“],Ç`ðKénU·ÑÌ>>;·Š,0<¶ +ÑÛw“ô§ÒZ È/@å©1êË^yPŠ]P¢/Sjv^T¯F­~ô„ÜE Û6|béõøž½!l}ÛBLÏJ \ No newline at end of file diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/RevocationPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/RevocationPublicKey new file mode 100644 index 0000000000..408701c49b --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/msp/RevocationPublicKey @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE1J1r07KNwf/mrewK14CF7fFLrav/iMWq +qxbcf94oBfdceIWtoVcj3PM7N8EHaqkM/EegydKhCnRtq4L4f3ZZDWFkhtKtoxz8 +gvlzp3oSVANXvCwu87ov8m1VegAJR0mg +-----END PUBLIC KEY----- diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/user/SignerConfig b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix/user/SignerConfig new file mode 100644 index 0000000000000000000000000000000000000000..a2d76ddaf8bb437b3264782a63fbdc2f8d197e5d GIT binary patch literal 617 zcmd=3#mH6AqN=)@-{JrHgNt;wZ#}*KbI{-9xpmfTk3$5vs<$;V6@9z^RacznSLD@Q zcKiOzxxWiyRB7(usd=d(*`UTJ5#X@kfkK32gJANZb~TQ$_2-1MKgtyUk)JS)-ICd+ zsq)3k(?_jdJP}w?tNZfQo}{A-wS^SoKeDt~@=JKEe0ads^wPYQC$~90h}+4qAu>;O zubY6$OCbdY{D4VFLHIQ1TTQK%))5Dj&R0&8WZSzUZ|eg7k6V_;yxYlac~(zI!8~H0 zU~A_oYb%{S5_33@Z)a+M`dnhS;r$!icr*fePq+vvn6&utwnf=1iPW8GT{vrTw#svp zcurxrh#4NHzx{m$-brz%RwU*Y~t;F4T>H|EDeLe~aPl*kGx~7&jmPNac$!pQ35B*#d)i_wy zb&m=J9(z)C<(Gps)0RN)l&Z%U%emJutF2(&{r*Zr*olLRdv~z09a*5a+~kbWnoAqB z4|UHxZKqM!x;%NkTFIo<;d(Py+ne*M$GnkUxN0SP{D=6;eLPREsu$Jf3HF>kd+e5; zsnpuPvsd-(y}UfvX;x-n!bP1)RwvI`uUXXjaB@f+#|{lfsdR%>CIhp?<`?&-*NM$e zslU9?el@$L*=qNVtFAfSI&HJayK6_xh5T~4k3C9e(VCm3r-z>;·Š,0<¶ +ÑÛw“ô§ÒZ È/@å©1êË^yPŠ]P¢/Sjv^T¯F­~ô„ÜE Û6|béõøž½!l}ÛBLÏJ \ No newline at end of file diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/msp/RevocationPublicKey b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/msp/RevocationPublicKey new file mode 100644 index 0000000000..408701c49b --- /dev/null +++ b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/msp/RevocationPublicKey @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE1J1r07KNwf/mrewK14CF7fFLrav/iMWq +qxbcf94oBfdceIWtoVcj3PM7N8EHaqkM/EegydKhCnRtq4L4f3ZZDWFkhtKtoxz8 +gvlzp3oSVANXvCwu87ov8m1VegAJR0mg +-----END PUBLIC KEY----- diff --git a/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/user/SignerConfig b/token/services/identity/idemix/testdata/bls12_381_bbs_gurvy/idemix2/user/SignerConfig new file mode 100644 index 0000000000000000000000000000000000000000..5138a0e01bd0e60be116f72c4088834d6ca9beef GIT binary patch literal 615 zcmd=3#mH4K&1mg3hAOp78=WgVe{ncSDn;;rFSd-5TPO4N=%y5z$G_UAUh%lG?dC*{ zwAl;h1)g_*SR~TYeIzZfahbYSUYV9oA~Zw;=Rv84YYQ4 zUJ5BB%?Jk>p;ZN7pvc|G#*D-l5+Vr8HYoZzltGez{ zfxu%=s;>NUux8p4$emL4_+mNt8fLW>th?V|X$U)UP;u`LHnt-R^p=~PFROj4uU9LXv^rdG=4yL$UiFwavI|$OWRL$4U%8Lx=~eZj+C0IYlV^|J(leD> z`*-%Lp1qfs=Q_>G3{1GFGs)`Y8S6ERIv-9BY2(z> z_w3$PFW3F}j>*=$D_4alT(eeLRrny%xMMcc<|elF=cAGz?eb+ZWVoH+xY_=_(?;gB x{dM|ZtY_sKR38`eUnPEU?z8=iB(00Su}N?|6<_f*Bhm2R4{@=HR?J2Q1^_%H2QdHu literal 0 HcmV?d00001 diff --git a/token/services/identity/idemix/testdata/generate.go b/token/services/identity/idemix/testdata/generate.go index 8a29e7af18..2e478d638d 100644 --- a/token/services/identity/idemix/testdata/generate.go +++ b/token/services/identity/idemix/testdata/generate.go @@ -9,3 +9,7 @@ package testdata //go:generate idemixgen ca-keygen --output ./bls12_381_bbs/ca --curve BLS12_381_BBS --aries //go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs/ca --output ./bls12_381_bbs/idemix --admin -u example.com -e alice -r 150 --curve BLS12_381_BBS --aries //go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs/ca --output ./bls12_381_bbs/idemix2 --admin -u example.com -e bob -r 200 --curve BLS12_381_BBS --aries + +//go:generate idemixgen ca-keygen --output ./bls12_381_bbs_gurvy/ca --curve BLS12_381_BBS_GURVY --aries +//go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs_gurvy/ca --output ./bls12_381_bbs_gurvy/idemix --admin -u example.com -e alice -r 150 --curve BLS12_381_BBS_GURVY --aries +//go:generate idemixgen signerconfig --ca-input ./bls12_381_bbs_gurvy/ca --output ./bls12_381_bbs_gurvy/idemix2 --admin -u example.com -e bob -r 200 --curve BLS12_381_BBS_GURVY --aries diff --git a/token/services/identity/storage/kvs/hashicorp/go.mod b/token/services/identity/storage/kvs/hashicorp/go.mod index 323b0206d7..8df0a84983 100644 --- a/token/services/identity/storage/kvs/hashicorp/go.mod +++ b/token/services/identity/storage/kvs/hashicorp/go.mod @@ -22,11 +22,12 @@ require ( github.com/IBM/idemix v0.0.2-0.20250313153527-832db18b9478 // indirect github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20250313153527-832db18b9478 // indirect github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478 // indirect - github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5 // indirect + github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.14.3 // indirect + github.com/bits-and-blooms/bitset v1.20.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -71,7 +72,6 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect @@ -113,12 +113,12 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.38.0 // indirect + golang.org/x/crypto v0.39.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/net v0.40.0 // indirect golang.org/x/sync v0.14.0 // indirect golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.25.0 // indirect + golang.org/x/text v0.26.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect @@ -132,5 +132,4 @@ require ( modernc.org/sqlite v1.33.1 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect - rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/token/services/identity/storage/kvs/hashicorp/go.sum b/token/services/identity/storage/kvs/hashicorp/go.sum index cf06af9d8f..ca027477ca 100644 --- a/token/services/identity/storage/kvs/hashicorp/go.sum +++ b/token/services/identity/storage/kvs/hashicorp/go.sum @@ -11,8 +11,8 @@ github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20250313153527-832db18b9478 h github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20250313153527-832db18b9478/go.mod h1:k4Q5EYKRnYC6t80ipSCY3G8H4FdcxRa8jjlsJdGfNCY= github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478 h1:Uzmcb4pNb54/fbAjnrZTiJwWV74+twP60N4qBGm4PvU= github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478/go.mod h1:Pi1QIuIZ+1OXIbnYe27vNwJOnSq2WvkHRT/sfweTw8E= -github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5 h1:wfksZZMeYfPeqsXwiotUsbnOqGGpth6t8Ij4tJ/91kw= -github.com/IBM/mathlib v0.0.3-0.20241219051532-81539b287cf5/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= +github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 h1:TelnQIceKrhWVmuFnMXyKyq0WUG5zMT6u+7wnRMkcFY= +github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3/go.mod h1:O230ebw6/22B7T4C03b99ZcPtc5XAfBTOp+ZT+xmMCk= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= @@ -21,10 +21,12 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.14.3 h1:Gd2c8lSNf9pKXom5JtD7AaKO8o7fGQ2LtFj1436qilA= -github.com/bits-and-blooms/bitset v1.14.3/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= +github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= +github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo= @@ -94,7 +96,6 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= @@ -160,8 +161,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4= +github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -175,9 +176,6 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= -github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= @@ -295,16 +293,16 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -315,8 +313,8 @@ golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -331,8 +329,8 @@ golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -343,8 +341,8 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= -golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -397,5 +395,3 @@ modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/token/services/identity/storage/kvs/tracker.go b/token/services/identity/storage/kvs/tracker.go index ba8ab96375..879fcfac51 100644 --- a/token/services/identity/storage/kvs/tracker.go +++ b/token/services/identity/storage/kvs/tracker.go @@ -6,7 +6,10 @@ SPDX-License-Identifier: Apache-2.0 package kvs -import "context" +import ( + "context" + "sync" +) // Backend interface for key-value storage type Backend interface { @@ -28,6 +31,8 @@ type TrackedKVS struct { GetCounter int PutHistory []KeyValuePair GetHistory []KeyValuePair + + mutex sync.RWMutex } func NewTrackedMemory() *TrackedKVS { @@ -51,6 +56,9 @@ func NewTrackedMemoryFrom(backend Backend) *TrackedKVS { } func (f *TrackedKVS) Put(id string, entry interface{}) error { + f.mutex.Lock() + defer f.mutex.Unlock() + err := f.Backend.Put(context.Background(), id, entry) f.PutCounter++ f.PutHistory = append(f.PutHistory, KeyValuePair{Key: id, Value: entry, Error: ""}) @@ -58,6 +66,9 @@ func (f *TrackedKVS) Put(id string, entry interface{}) error { } func (f *TrackedKVS) Get(id string, entry interface{}) error { + f.mutex.Lock() + defer f.mutex.Unlock() + f.GetCounter++ errorMsg := "" From a3f00165e35cc94964ee74aa65573eb8662f57d6 Mon Sep 17 00:00:00 2001 From: Angelo De Caro Date: Fri, 18 Jul 2025 12:04:32 +0200 Subject: [PATCH 2/4] enable all variants Signed-off-by: Angelo De Caro --- token/services/identity/idemix/km_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/token/services/identity/idemix/km_test.go b/token/services/identity/idemix/km_test.go index 074ed57eda..48664e0118 100644 --- a/token/services/identity/idemix/km_test.go +++ b/token/services/identity/idemix/km_test.go @@ -592,9 +592,9 @@ func TestIdentityFromFabricCAWithEidRhNymPolicy(t *testing.T) { } func TestKeyManagerForRace(t *testing.T) { - // testKeyManagerForRace(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + testKeyManagerForRace(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) testKeyManagerForRace(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) - // testKeyManagerForRace(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + testKeyManagerForRace(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) } func testKeyManagerForRace(t *testing.T, configPath string, curveID math.CurveID, aries bool) { From 79ee2d0c83c9cdd40fa7ada55c2a33c6bbf51a33 Mon Sep 17 00:00:00 2001 From: Marcus Brandenburger Date: Thu, 24 Jul 2025 11:02:30 +0200 Subject: [PATCH 3/4] Add Idemix KM benchmark Signed-off-by: Marcus Brandenburger --- .../services/identity/idemix/km_bench_test.go | 45 +++++++++++++++++++ token/services/identity/idemix/km_test.go | 41 ++++++++++++----- 2 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 token/services/identity/idemix/km_bench_test.go diff --git a/token/services/identity/idemix/km_bench_test.go b/token/services/identity/idemix/km_bench_test.go new file mode 100644 index 0000000000..adb85d6b1f --- /dev/null +++ b/token/services/identity/idemix/km_bench_test.go @@ -0,0 +1,45 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package idemix + +import ( + "testing" + + math "github.com/IBM/mathlib" +) + +func BenchmarkKmIdentity(b *testing.B) { + b.Run("FP256BN_AMCL", func(b *testing.B) { + b.ReportAllocs() + + keyManager, cleanup := setupKeyManager(b, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + defer cleanup() + for b.Loop() { + _, _, _ = keyManager.Identity(b.Context(), nil) + } + }) + + b.Run("BLS12_381_BBS", func(b *testing.B) { + b.ReportAllocs() + + keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) + defer cleanup() + for b.Loop() { + _, _, _ = keyManager.Identity(b.Context(), nil) + } + }) + + b.Run("BLS12_381_BBS_GURVY", func(b *testing.B) { + b.ReportAllocs() + + keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + defer cleanup() + for b.Loop() { + _, _, _ = keyManager.Identity(b.Context(), nil) + } + }) +} diff --git a/token/services/identity/idemix/km_test.go b/token/services/identity/idemix/km_test.go index 48664e0118..a78c2bb43c 100644 --- a/token/services/identity/idemix/km_test.go +++ b/token/services/identity/idemix/km_test.go @@ -592,13 +592,26 @@ func TestIdentityFromFabricCAWithEidRhNymPolicy(t *testing.T) { } func TestKeyManagerForRace(t *testing.T) { - testKeyManagerForRace(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) - testKeyManagerForRace(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) - testKeyManagerForRace(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + t.Run("FP256BN_AMCL", func(t *testing.T) { + keyManager, cleanup := setupKeyManager(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + defer cleanup() + runIdentityConcurrently(t, t.Context(), keyManager) + }) + + t.Run("BLS12_381_BBS", func(t *testing.T) { + keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) + defer cleanup() + runIdentityConcurrently(t, t.Context(), keyManager) + }) + + t.Run("BLS12_381_BBS_GURVY", func(t *testing.T) { + keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + defer cleanup() + runIdentityConcurrently(t, t.Context(), keyManager) + }) } -func testKeyManagerForRace(t *testing.T, configPath string, curveID math.CurveID, aries bool) { - // prepare +func setupKeyManager(t assert.TestingT, configPath string, curveID math.CurveID, aries bool) (*KeyManager, func()) { kvs, err := kvs2.NewInMemory() assert.NoError(t, err) sigService := sig.NewService(sig.NewMultiplexDeserializer(), kvs2.NewIdentityStore(kvs, token.TMSID{Network: "pineapple"})) @@ -630,16 +643,24 @@ func testKeyManagerForRace(t *testing.T, configPath string, curveID math.CurveID assert.Equal(t, tracker.PutCounter, 1) assert.Equal(t, tracker.GetCounter, 0) + return keyManager, func() { + // cleanup + } +} + +func runIdentityConcurrently(t assert.TestingT, ctx context.Context, keyManager *KeyManager) { numRoutines := 4 - wg := sync.WaitGroup{} + var wg sync.WaitGroup wg.Add(numRoutines) - for i := 0; i < numRoutines; i++ { + for range numRoutines { go func() { defer wg.Done() - for i := 0; i < 10; i++ { - _, _, err := keyManager.Identity(context.Background(), nil) - assert.NoError(t, err) + for range 10 { + newId, newRaw, err2 := keyManager.Identity(ctx, nil) + assert.NoError(t, err2) + assert.NotNil(t, newId) + assert.NotEmpty(t, newRaw) } }() } From c21239d5635b27dc93c5aafad00b5ef2ed83551d Mon Sep 17 00:00:00 2001 From: Angelo De Caro Date: Wed, 10 Sep 2025 15:45:29 +0200 Subject: [PATCH 4/4] rebase fix Signed-off-by: Angelo De Caro --- go.mod | 8 +-- go.sum | 8 +-- .../identity/idemix/cache/cache_test.go | 13 +++-- .../services/identity/idemix/km_bench_test.go | 13 ++--- token/services/identity/idemix/km_test.go | 49 ++++++++----------- .../identity/storage/kvs/hashicorp/go.mod | 6 +-- .../identity/storage/kvs/hashicorp/go.sum | 8 +-- 7 files changed, 43 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index 706a258b34..e927527ff1 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/IBM/idemix v0.0.2-0.20250313153527-832db18b9478 github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478 - github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 + github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/gin-gonic/gin v1.10.0 github.com/gobuffalo/packr/v2 v2.7.1 github.com/hashicorp/go-uuid v1.0.3 @@ -34,7 +34,7 @@ require ( go.uber.org/dig v1.18.0 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.39.0 - golang.org/x/sync v0.14.0 + golang.org/x/sync v0.15.0 google.golang.org/protobuf v1.36.6 gopkg.in/yaml.v2 v2.4.0 modernc.org/sqlite v1.33.1 @@ -73,8 +73,6 @@ require ( github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.13.0 // indirect github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/log v0.1.0 // indirect @@ -282,8 +280,6 @@ require ( golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/mod v0.25.0 // indirect golang.org/x/net v0.40.0 // indirect - golang.org/x/oauth2 v0.26.0 // indirect - golang.org/x/sync v0.15.0 // indirect golang.org/x/oauth2 v0.27.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.26.0 // indirect diff --git a/go.sum b/go.sum index d50d64d00c..d13a67c473 100644 --- a/go.sum +++ b/go.sum @@ -728,18 +728,14 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 h1:Om6kYQYDUk5wWbT0t0q6pvyM49i9XZAv9dDrkDA7gjk= github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= -github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= -github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo= github.com/cockroachdb/errors v1.12.0/go.mod h1:SvzfYNNBshAVbZ8wzNc/UPK3w1vf0dKDUP41ucAIf7g= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.13.0 h1:VPULb/v6bbYELAPTDFINEVaMTTybV5GLxDdcjnS+4oc= -github.com/consensys/gnark-crypto v0.13.0/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= +github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= +github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= diff --git a/token/services/identity/idemix/cache/cache_test.go b/token/services/identity/idemix/cache/cache_test.go index c38d29f1cc..b37ea245c5 100644 --- a/token/services/identity/idemix/cache/cache_test.go +++ b/token/services/identity/idemix/cache/cache_test.go @@ -36,8 +36,11 @@ func TestIdentityCache(t *testing.T) { } func TestIdentityCacheForRace(t *testing.T) { - c := NewIdentityCache(func(context.Context, []byte) (driver.Identity, []byte, error) { - return []byte("hello world"), []byte("audit"), nil + c := NewIdentityCache(func(context.Context, []byte) (*idriver.IdentityDescriptor, error) { + return &idriver.IdentityDescriptor{ + Identity: []byte("hello world"), + AuditInfo: []byte("audit"), + }, nil }, 10000, nil, NewMetrics(&disabled.Provider{})) numRoutines := 4 @@ -48,10 +51,10 @@ func TestIdentityCacheForRace(t *testing.T) { defer wg.Done() for i := 0; i < 100; i++ { - id, audit, err := c.Identity(context.Background(), nil) + id, err := c.Identity(t.Context(), nil) assert.NoError(t, err) - assert.Equal(t, driver.Identity([]byte("hello world")), id) - assert.Equal(t, []byte("audit"), audit) + assert.Equal(t, driver.Identity("hello world"), id.Identity) + assert.Equal(t, []byte("audit"), id.AuditInfo) } }() } diff --git a/token/services/identity/idemix/km_bench_test.go b/token/services/identity/idemix/km_bench_test.go index adb85d6b1f..7451169ea0 100644 --- a/token/services/identity/idemix/km_bench_test.go +++ b/token/services/identity/idemix/km_bench_test.go @@ -16,30 +16,31 @@ func BenchmarkKmIdentity(b *testing.B) { b.Run("FP256BN_AMCL", func(b *testing.B) { b.ReportAllocs() - keyManager, cleanup := setupKeyManager(b, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + keyManager, cleanup := setupKeyManager(b, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL) defer cleanup() for b.Loop() { - _, _, _ = keyManager.Identity(b.Context(), nil) + _, _ = keyManager.Identity(b.Context(), nil) } }) b.Run("BLS12_381_BBS", func(b *testing.B) { b.ReportAllocs() - keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) + // in this case, the backed uses GURVY directly + keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS) defer cleanup() for b.Loop() { - _, _, _ = keyManager.Identity(b.Context(), nil) + _, _ = keyManager.Identity(b.Context(), nil) } }) b.Run("BLS12_381_BBS_GURVY", func(b *testing.B) { b.ReportAllocs() - keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + keyManager, cleanup := setupKeyManager(b, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY) defer cleanup() for b.Loop() { - _, _, _ = keyManager.Identity(b.Context(), nil) + _, _ = keyManager.Identity(b.Context(), nil) } }) } diff --git a/token/services/identity/idemix/km_test.go b/token/services/identity/idemix/km_test.go index a78c2bb43c..8ab1fc72f2 100644 --- a/token/services/identity/idemix/km_test.go +++ b/token/services/identity/idemix/km_test.go @@ -22,7 +22,6 @@ import ( _ "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/memory" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/view" "github.com/hyperledger-labs/fabric-token-sdk/token" - tdriver "github.com/hyperledger-labs/fabric-token-sdk/token/driver" "github.com/hyperledger-labs/fabric-token-sdk/token/services/identity" "github.com/hyperledger-labs/fabric-token-sdk/token/services/identity/deserializer" crypto2 "github.com/hyperledger-labs/fabric-token-sdk/token/services/identity/idemix/crypto" @@ -33,11 +32,11 @@ import ( ) func TestNewKeyManager(t *testing.T) { - testNewKeyManager(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) - testNewKeyManager(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY, true) + testNewKeyManager(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL) + testNewKeyManager(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY) } -func testNewKeyManager(t *testing.T, configPath string, curveID math.CurveID, aries bool) { +func testNewKeyManager(t *testing.T, configPath string, curveID math.CurveID) { t.Helper() // prepare kvs, err := kvs2.NewInMemory() @@ -313,11 +312,11 @@ func testIdentityStandard(t *testing.T, configPath string, curveID math.CurveID, } func TestAuditWithEidRhNymPolicy(t *testing.T) { - testAuditWithEidRhNymPolicy(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) - testAuditWithEidRhNymPolicy(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY, true) + testAuditWithEidRhNymPolicy(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL) + testAuditWithEidRhNymPolicy(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY) } -func testAuditWithEidRhNymPolicy(t *testing.T, configPath string, curveID math.CurveID, aries bool) { +func testAuditWithEidRhNymPolicy(t *testing.T, configPath string, curveID math.CurveID) { t.Helper() registry := view.NewServiceProvider() @@ -371,11 +370,11 @@ func testAuditWithEidRhNymPolicy(t *testing.T, configPath string, curveID math.C } func TestKeyManager_DeserializeSigner(t *testing.T) { - testKeyManager_DeserializeSigner(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) - testKeyManager_DeserializeSigner(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY, true) + testKeyManager_DeserializeSigner(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL) + testKeyManager_DeserializeSigner(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS_GURVY) } -func testKeyManager_DeserializeSigner(t *testing.T, configPath string, curveID math.CurveID, aries bool) { +func testKeyManager_DeserializeSigner(t *testing.T, configPath string, curveID math.CurveID) { t.Helper() // prepare registry := view.NewServiceProvider() @@ -593,46 +592,45 @@ func TestIdentityFromFabricCAWithEidRhNymPolicy(t *testing.T) { func TestKeyManagerForRace(t *testing.T) { t.Run("FP256BN_AMCL", func(t *testing.T) { - keyManager, cleanup := setupKeyManager(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL, false) + keyManager, cleanup := setupKeyManager(t, "./testdata/fp256bn_amcl/idemix", math.FP256BN_AMCL) defer cleanup() runIdentityConcurrently(t, t.Context(), keyManager) }) t.Run("BLS12_381_BBS", func(t *testing.T) { - keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS, true) + keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs/idemix", math.BLS12_381_BBS) defer cleanup() runIdentityConcurrently(t, t.Context(), keyManager) }) t.Run("BLS12_381_BBS_GURVY", func(t *testing.T) { - keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY, true) + keyManager, cleanup := setupKeyManager(t, "./testdata/bls12_381_bbs_gurvy/idemix", math.BLS12_381_BBS_GURVY) defer cleanup() runIdentityConcurrently(t, t.Context(), keyManager) }) } -func setupKeyManager(t assert.TestingT, configPath string, curveID math.CurveID, aries bool) (*KeyManager, func()) { +func setupKeyManager(t assert.TestingT, configPath string, curveID math.CurveID) (*KeyManager, func()) { kvs, err := kvs2.NewInMemory() assert.NoError(t, err) - sigService := sig.NewService(sig.NewMultiplexDeserializer(), kvs2.NewIdentityStore(kvs, token.TMSID{Network: "pineapple"})) config, err := crypto2.NewConfig(configPath) assert.NoError(t, err) tracker := kvs2.NewTrackedMemoryFrom(kvs) keyStore, err := crypto2.NewKeyStore(curveID, tracker) assert.NoError(t, err) - cryptoProvider, err := crypto2.NewBCCSP(keyStore, curveID, aries) + cryptoProvider, err := crypto2.NewBCCSP(keyStore, curveID) assert.NoError(t, err) // check that version is enforced config.Version = 0 - _, err = NewKeyManager(config, sigService, types.EidNymRhNym, cryptoProvider) + _, err = NewKeyManager(config, types.EidNymRhNym, cryptoProvider) assert.Error(t, err) assert.EqualError(t, err, "unsupported protocol version [0]") config.Version = crypto2.ProtobufProtocolVersionV1 // new key manager loaded from file assert.Empty(t, config.Signer.Ski) - keyManager, err := NewKeyManager(config, sigService, types.EidNymRhNym, cryptoProvider) + keyManager, err := NewKeyManager(config, types.EidNymRhNym, cryptoProvider) assert.NoError(t, err) assert.NotNil(t, keyManager) assert.False(t, keyManager.IsRemote()) @@ -657,20 +655,13 @@ func runIdentityConcurrently(t assert.TestingT, ctx context.Context, keyManager defer wg.Done() for range 10 { - newId, newRaw, err2 := keyManager.Identity(ctx, nil) + id, err2 := keyManager.Identity(ctx, nil) assert.NoError(t, err2) - assert.NotNil(t, newId) - assert.NotEmpty(t, newRaw) + assert.NotNil(t, id) + assert.NotEmpty(t, id.Identity) + assert.NotNil(t, id.Signer) } }() } wg.Wait() } - -type TypedSignerDeserializer struct { - *KeyManager -} - -func (t *TypedSignerDeserializer) DeserializeSigner(ctx context.Context, typ identity.Type, raw []byte) (tdriver.Signer, error) { - return t.KeyManager.DeserializeSigner(ctx, raw) -} diff --git a/token/services/identity/storage/kvs/hashicorp/go.mod b/token/services/identity/storage/kvs/hashicorp/go.mod index 8df0a84983..dab7e8436b 100644 --- a/token/services/identity/storage/kvs/hashicorp/go.mod +++ b/token/services/identity/storage/kvs/hashicorp/go.mod @@ -27,13 +27,11 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.20.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.13.0 // indirect + github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect @@ -116,7 +114,7 @@ require ( golang.org/x/crypto v0.39.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/net v0.40.0 // indirect - golang.org/x/sync v0.14.0 // indirect + golang.org/x/sync v0.15.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.26.0 // indirect golang.org/x/time v0.8.0 // indirect diff --git a/token/services/identity/storage/kvs/hashicorp/go.sum b/token/services/identity/storage/kvs/hashicorp/go.sum index ca027477ca..f4c9906e73 100644 --- a/token/services/identity/storage/kvs/hashicorp/go.sum +++ b/token/services/identity/storage/kvs/hashicorp/go.sum @@ -25,8 +25,6 @@ github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3M github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= -github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cockroachdb/errors v1.12.0 h1:d7oCs6vuIMUQRVbi6jWWWEJZahLCfJpnJSVobd1/sUo= @@ -35,10 +33,8 @@ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZe github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.13.0 h1:VPULb/v6bbYELAPTDFINEVaMTTybV5GLxDdcjnS+4oc= -github.com/consensys/gnark-crypto v0.13.0/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= +github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0= +github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=