Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

[crypto-conditions] Clarify Threshold Fingerprint Generation #4

Closed
hyperledger-quilt opened this issue Oct 24, 2017 · 5 comments
Closed
Labels

Comments

@hyperledger-quilt
Copy link

Issue by sappenin
Monday Jul 24, 2017 at 15:52 GMT
Originally opened as interledger-deprecated/java-crypto-conditions#63


While investing the Java test failures, I noticed that some of the ThresholdCondition's fingerprint generation results don't line-up with the TestVectors published in the CryptoCondition RFC project.

For example, looking at the fingerprintContents binary in 0008_test-basic-threshold.json, I see the following:

308184800102A17FA12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000

However, in the Java code, the following call...

BaseEncoding.base16().encode(CryptoConditionReader .readFulfillment(BaseEncoding.base16().decode(testVector.getFulfillment())).getCondition().getFingerprint());

yields the only following fingerprint value:

31AF10E168BA56AB38BEBF27065413C76896A6683C53D746F15A6438FD2A6C66

I think the source of the problem is that method ThresholdSha256Condition.getFingerprintContents() only looks at the subconditions when computing the fingerprint. When CryptoConditionsReader reads the binary of the fulfillment in the test vector, it yields a ThresholdFulfillment with one subcondition and two subfulfillments (one RsaSha256Condition and then one PrefixSha256Fulfillment and a Ed25519Fulfillment).

Is it possible that the implementation is wrong, and should somehow be considering the genrated Condition of each subfulfillment, too?

As it stands, the fingerprint in the TestVector seems to have much more data than anything I can generate using the Java library.

@hyperledger-quilt
Copy link
Author

Comment by adrianhopebailie
Tuesday Jul 25, 2017 at 08:45 GMT


Off the top of my head that test vector looks wrong. The fingerprint should be a constant length.

@hyperledger-quilt
Copy link
Author

Comment by adrianhopebailie
Tuesday Jul 25, 2017 at 08:46 GMT


@justmoon ⬆️

@hyperledger-quilt
Copy link
Author

Comment by sappenin
Saturday Jul 29, 2017 at 15:18 GMT


I created rfcs/crypto-conditions#27 so this issue doesn't get lost in the RFC project (and for linkage).

@hyperledger-quilt
Copy link
Author

Comment by adrianhopebailie
Tuesday Sep 19, 2017 at 16:38 GMT


Bump @justmoon

@sappenin
Copy link
Contributor

Closing in-favor of ripple/crypto-conditions#10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants