Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PaymentServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
PaymentServer
Commits
6fbaac7a
Commit
6fbaac7a
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
switch to a documentable data structure
parent
19666ba4
No related branches found
No related tags found
1 merge request
!22
Ristretto-flavored PrivacyPass
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/PaymentServer/Issuer.hs
+3
-2
3 additions, 2 deletions
src/PaymentServer/Issuer.hs
src/PaymentServer/Ristretto.hs
+12
-10
12 additions, 10 deletions
src/PaymentServer/Ristretto.hs
with
15 additions
and
12 deletions
src/PaymentServer/Issuer.hs
+
3
−
2
View file @
6fbaac7a
...
...
@@ -14,7 +14,8 @@ module PaymentServer.Issuer
)
where
import
PaymentServer.Ristretto
(
ristretto
(
Issuance
(
Issuance
)
,
ristretto
)
import
Data.Text
...
...
@@ -68,5 +69,5 @@ ristrettoIssue
ristrettoIssue
signingKey
tokens
=
do
let
issuance
=
ristretto
signingKey
tokens
case
issuance
of
Right
(
publicKey
,
tokens
,
proof
)
->
Right
$
ChallengeBypass
publicKey
tokens
proof
Right
(
Issuance
publicKey
tokens
proof
)
->
Right
$
ChallengeBypass
publicKey
tokens
proof
Left
err
->
Left
.
pack
.
show
$
err
This diff is collapsed.
Click to expand it.
src/PaymentServer/Ristretto.hs
+
12
−
10
View file @
6fbaac7a
...
...
@@ -3,7 +3,8 @@
{-# LANGUAGE EmptyDataDecls #-}
module
PaymentServer.Ristretto
(
randomSigningKey
(
Issuance
(
Issuance
)
,
randomSigningKey
,
ristretto
)
where
...
...
@@ -62,14 +63,15 @@ foreign import ccall "batch_dleq_proof_encode_base64" batch_dleq_proof_encode_ba
foreign
import
ccall
"batch_dleq_proof_destroy"
batch_dleq_proof_destroy
::
Ptr
C_BatchDLEQProof
->
IO
()
-- | Private type to represent the return value of ristretto.
type
Issuance
=
(
Text
-- ^ The base64-encoded public key corresponding to the
data
Issuance
=
Issuance
{
publicKey
::
Text
-- ^ The base64-encoded public key corresponding to the
-- signing key which generated the signatures.
,
[
Text
]
-- ^ A list of base64-encoded token signatures.
,
Text
-- ^ The base64-encoded batch DLEQ proof that the signatures
,
signatures
::
[
Text
]
-- ^ A list of base64-encoded token signatures.
,
proof
::
Text
-- ^ The base64-encoded batch DLEQ proof that the signatures
-- were made with the signing key corresponding to the public
-- key.
)
}
data
RistrettoFailure
=
SigningKeyAllocation
...
...
@@ -147,7 +149,7 @@ ristretto textSigningKey textTokens =
False
->
do
encodedSignedTokens
<-
mapM
peekCString
encodedCStringSignedTokens
encodedProof
<-
newEncodedProof
blindedTokens
signedTokens
signingKey
return
$
Right
(
pack
encodedPublicKey
,
map
pack
encodedSignedTokens
,
pack
encodedProof
)
return
.
Right
$
Issuance
(
pack
encodedPublicKey
)
(
map
pack
encodedSignedTokens
)
(
pack
encodedProof
)
-- | randomSigningKey generates a new signing key at random and returns it
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment