M secret-sharing/client.rkt => secret-sharing/client.rkt +39 -36
@@ 43,11 43,12 @@
(update-port (update-host json-requester "localhost") 1984))
(displayln "registering...")
- (post bulletin "/register"
- #:data
- (jsexpr->string (hasheq 'input (bytes->hex-string
- (integer->bytes point num-bytes #f #t))
- 'name username)))
+ (void
+ (post bulletin "/register"
+ #:data
+ (jsexpr->string (hasheq 'input (bytes->hex-string
+ (integer->bytes point num-bytes #f #t))
+ 'name username))))
(display "retrieving peers...")
(define peer-inputs
@@ 80,39 81,41 @@
(define poly (random-poly (sub1 (length peer-inputs)) vote))
(displayln "submitting poly outputs...")
- (post bulletin "/outputs"
- #:data
- (jsexpr->string
- (for/hasheq ([p (in-list peer-inputs)])
- (values (string->symbol (natural->hex-string p))
- (natural->hex-string (poly p))))))
+ (void
+ (post bulletin "/outputs"
+ #:data
+ (jsexpr->string
+ (for/hasheq ([p (in-list peer-inputs)])
+ (values (string->symbol (natural->hex-string p))
+ (natural->hex-string (poly p)))))))
(display "summing...")
- (post bulletin "/sum"
- #:data
- (jsexpr->string
- (hasheq
- 'input
- (natural->hex-string point)
- 'sum
- (natural->hex-string
- (foldl + 0
- (map
- hex-string->natural
- (json-response-body
- (let loop ([wait 0])
- (sleep wait)
- (with-handlers ([exn:fail:network:http:error?
- (λ (exn)
- (break-enabled #t)
- (display ".")
- (flush-output)
- (loop 3))])
- (post bulletin "/values"
- #:data
- (jsexpr->string
- (hasheq 'input
- (natural->hex-string point)))))))))))))
+ (void
+ (post bulletin "/sum"
+ #:data
+ (jsexpr->string
+ (hasheq
+ 'input
+ (natural->hex-string point)
+ 'sum
+ (natural->hex-string
+ (foldl + 0
+ (map
+ hex-string->natural
+ (json-response-body
+ (let loop ([wait 0])
+ (sleep wait)
+ (with-handlers ([exn:fail:network:http:error?
+ (λ (exn)
+ (break-enabled #t)
+ (display ".")
+ (flush-output)
+ (loop 3))])
+ (post bulletin "/values"
+ #:data
+ (jsexpr->string
+ (hasheq 'input
+ (natural->hex-string point))))))))))))))
(newline)
(display "summing sums...")