Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Threshold Fingerprint Generation #10

Open
sappenin opened this issue Apr 28, 2018 · 1 comment
Open

Clarify Threshold Fingerprint Generation #10

sappenin opened this issue Apr 28, 2018 · 1 comment
Labels
question Further information is requested

Comments

@sappenin
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant