-
Notifications
You must be signed in to change notification settings - Fork 471
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
Add new builtin hashing function ripemd_160
#6252
base: master
Are you sure you want to change the base?
Conversation
This is preliminary work which exposes RIPEMD-160 hashing primitive as a new bulitin.
|
a161078
to
db5cabb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this all looks OK. I'm impressed that you did the Agda as well!
However, we're hoping to merge the costing code for the extra bitwise builtins (which have already been merged) shortly. Can you wait until that's done so that all of the bitwise operations are in the same place, and then rebase and put ripemd160
after those? This may require some rearrangements in your code (and also quite a bit of other stuff has been merged since you opened this PR): apologies for that.
@@ -527,6 +527,19 @@ | |||
"type": "constant_cost" | |||
} | |||
}, | |||
"ripemd_160": { | |||
"cpu": { | |||
"arguments": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must have run the benchmarks to get these numbers. Which machine did you run them on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwxm - unfortunately I did not benchmark this as I stated above:
This draft contains an artificial costing model for the new builtin - I copied keccak_256 related values for now.
That is for sure missing part :-( Sorry for the confusion.
@@ -76,7 +76,7 @@ testBuiltinVersions = testGroup "builtins" | |||
assertBool "not in l2,Vasil" $ isRight $ V2.deserialiseScript vasilPV serialiseDataExScript | |||
assertBool "not in l3,future" $ isRight $ V3.deserialiseScript futurePV serialiseDataExScript | |||
, testCase "bls,keccak256,blake2b224 only available in l3,Future and after" $ | |||
for_ [blsExScript, keccak256ExScript, blake2b224ExScript] $ \script -> do | |||
for_ [blsExScript, keccak256ExScript, blake2b224ExScript, ripemd160ExScript] $ \script -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure if ripemd160
should be in here, but these tests need to be reworked anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can drop it if you wish :-)
Sure. I will rebase and then we can sync how to finalize this PR. I'm really kin to have it merged - it will allow some fancy stuff on Cardano like checking Bitcoin witness under Bitcoin Tx etc. |
I'm going to close this in favour of #6378, which I'm just about to merge. |
I'm reopening this as a separate PR because of the permissions issue (I'm not able to push to the branch under
IntersectMBO/plutus
anymore.Pre-submit checklist: