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

Add unwrapKey to typescript interface #5792

Merged
merged 12 commits into from
Nov 2, 2023

Conversation

beejones
Copy link
Contributor

Added unwrapKey to ccfcrypto.
Make sure unit tests use the new unwrapKey function

@achamayou achamayou changed the title Add unwarpKey to typescript interface Add unwrapKey to typescript interface Oct 27, 2023
@achamayou
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@ccf-bot
Copy link
Collaborator

ccf-bot commented Oct 27, 2023

beejones/add-unwrap-in-typescript@78304 aka 20231102.11 vs main ewma over 20 builds from 77958 to 78284

Click to see table

main

build_id build_number pi_basic_mt_sgx_cft^ pi_basic_mt_sgx_cft_mem Commit latency factor tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem pi_basic_mt_virtual_cft^ pi_ls_sgx_cft^ pi_ls_sgx_cft_mem pi_basic_sgx_cft^ pi_basic_sgx_cft_mem tpcc_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ pi_basic_virtual_cft^ pi_basic_js_sgx_cft^ pi_basic_js_sgx_cft_mem pi_basic_js_virtual_cft^ ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_jwt_virtual_cft^ pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_full_js_virtual_cft^ ls_js_jwt_virtual_cft^ ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem hist_sgx_cft^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
77958 20231026.14 27891.3 2.30851e+07 0.772274 5566.37 8.59996e+07 14074.9 1.88908e+07 68096.1 14198.3 1.05021e+07 15598.1 1.46964e+07 17260.9 45673.6 48273.7 54086 1432.2 1.25993e+07 4383.2 6840.93 1.67936e+07 17108.5 6965.9 6.30784e+06 19101.5 17286.3 5777.94 1.67936e+07 14984.8 10377.2 5783.74 1.67936e+07 3984.61 1.67936e+07 43732 834153 1.18014e+06 8.15037e+06 3.08165e+07
77980 20231026.23 27919.7 2.30851e+07 0.799401 5544.83 8.59996e+07 13945.1 1.88908e+07 84229.4 14005.8 1.05021e+07 15441 1.25993e+07 17301.4 45630 47959.1 54124.7 1419.8 1.25993e+07 4420.8 7232.3 1.67936e+07 17150.6 6917.8 6.30784e+06 19602.5 17059.4 5811.09 1.67936e+07 14690.5 9850.2 5487 1.67936e+07 4003.14 1.67936e+07 42472.7 827669 1.18001e+06 8.13674e+06 3.08104e+07
77994 20231026.29 27941.4 2.51822e+07 0.80113 5582.56 8.59996e+07 14017.2 1.88908e+07 82095.1 14167 1.05021e+07 15610.3 1.25993e+07 17290 43873.2 47649.7 54065 1446 1.25993e+07 4441.8 6841.03 1.88908e+07 17136.7 6962.5 6.30784e+06 19419.7 17733.8 5764.66 1.67936e+07 16838 9840.75 5729.26 1.67936e+07 4003.36 1.67936e+07 44959.6 840437 1.18274e+06 8.15494e+06 3.07517e+07
78007 20231026.34 27449.9 2.51822e+07 0.765143 5628.96 8.59996e+07 14025.1 1.88908e+07 81427 14089.7 1.05021e+07 15601.5 1.46964e+07 17307 45407.5 47735 54044.5 1432.4 1.25993e+07 4441.4 6850.52 1.88908e+07 17288.5 7096.8 6.30784e+06 18904.7 17015.3 5773.88 1.67936e+07 16872.1 9816.73 5486.07 1.67936e+07 3985.52 1.67936e+07 43179.9 826445 1.17834e+06 8.14738e+06 3.19605e+07
78033 20231027.4 28127.4 2.51822e+07 0.798824 5577.93 8.59996e+07 13972.7 1.88908e+07 65638.2 14096.8 1.05021e+07 15447.2 1.25993e+07 17273 45862.4 48024.5 53817.4 1432.2 1.25993e+07 4439.6 7250.65 1.67936e+07 17160.1 6938.4 6.30784e+06 19602.8 17044.2 5786.4 1.67936e+07 16883.5 9854.32 5743.72 1.67936e+07 4002.74 1.67936e+07 42046.2 829984 1.18448e+06 8.13813e+06 3.06775e+07
78035 20231027.5 27938.3 2.51822e+07 0.785967 5573.65 8.59996e+07 14007.5 1.88908e+07 83501.4 14114.5 1.05021e+07 15503.3 1.46964e+07 17213.8 45970.2 48037.9 54501.8 1434.7 1.25993e+07 4447.9 6832.63 1.67936e+07 17062.2 6983.9 6.30784e+06 19333.8 16911.6 5786.59 1.67936e+07 17015.7 9990.67 5775.4 1.67936e+07 3982.36 1.67936e+07 47144 831267 1.18066e+06 8.09742e+06 3.06715e+07
78049 20231027.10 28049.5 2.51822e+07 0.781085 5504.64 8.59996e+07 14023.9 1.88908e+07 85552.5 14102.3 1.05021e+07 15421.6 1.46964e+07 17300.2 43575 46933.4 55026 1424.4 1.25993e+07 4431 6846.42 1.67936e+07 17056.6 6826.6 6.30784e+06 19111.7 17359 5791.73 1.67936e+07 14869.3 9805.16 5707.49 1.67936e+07 3980.86 1.67936e+07 41017.4 840517 1.18098e+06 8.16672e+06 3.06803e+07
78065 20231030.3 27850.6 2.30851e+07 0.803529 5645.18 8.59996e+07 14038.5 1.88908e+07 80986.2 14125 1.05021e+07 15560.2 1.46964e+07 17287.6 43811.1 46782.1 54407.3 1434 1.25993e+07 4392.3 7241.2 1.67936e+07 17198.2 7023.9 6.30784e+06 19724.6 17634.6 5804.59 1.67936e+07 14791.7 10345.8 5779.74 1.67936e+07 3998.35 1.67936e+07 38753.2 831589 1.1757e+06 8.07743e+06 3.07175e+07
78110 20231031.2 28002.1 2.30851e+07 0.801968 5577.82 8.59996e+07 14078.8 1.88908e+07 90290.4 14211.9 1.05021e+07 15500.2 1.46964e+07 17706.2 43757.1 47025.6 54021.7 1434.1 1.25993e+07 4412.2 7246.56 1.67936e+07 17043.4 7122.3 6.30784e+06 19501.2 17190 5824.15 1.67936e+07 14923.3 10161.5 5724.41 1.67936e+07 3999.43 1.67936e+07 44321.1 833541 1.17964e+06 8.15397e+06 3.09702e+07
78115 20231031.5 28096.6 2.51822e+07 0.788781 5597.14 8.59996e+07 14046.4 1.88908e+07 90398.6 14149.3 1.05021e+07 15573.1 1.46964e+07 17153.5 45717.6 47743.9 55284.5 1438.8 1.25993e+07 4374.5 6857.73 1.67936e+07 17204.3 6984.1 6.30784e+06 19257.8 17318.7 5786.81 1.67936e+07 14893.2 9790.65 5770.07 1.67936e+07 3994.27 1.67936e+07 44365.6 818357 1.17717e+06 8.15176e+06 3.07813e+07
78128 20231031.10 27738.1 2.51822e+07 0.75716 5630.66 8.59996e+07 14058.5 1.88908e+07 71982.3 14160.9 1.05021e+07 15631.8 1.46964e+07 17076.3 43862 47267.7 55100.9 1441.7 1.25993e+07 4371.6 7284.99 1.67936e+07 17200.1 7044.7 6.30784e+06 19235.2 17122 5805.39 1.67936e+07 14762.1 10396.2 5776.39 1.67936e+07 3998.07 1.67936e+07 42934.8 837504 1.18196e+06 8.15251e+06 3.15981e+07
78146 20231031.17 27901 2.51822e+07 0.780638 5598.38 8.59996e+07 14060.8 1.88908e+07 76464.7 14179 1.05021e+07 15535.7 1.46964e+07 17229.5 43813 47595.9 55096.1 1433.1 1.25993e+07 4355.7 6790.28 1.67936e+07 17361 6889.6 6.30784e+06 19744.5 17356.3 5772.45 1.67936e+07 14955.7 9799.34 5488.66 1.67936e+07 3966.05 1.67936e+07 43021.9 820080 1.18077e+06 8.15047e+06 3.07762e+07
78161 20231031.23 28091.4 2.51822e+07 0.782488 5605.13 8.59996e+07 14058.7 1.88908e+07 62893.4 14092.9 1.05021e+07 15472.1 1.46964e+07 17341.2 43725.6 47396.3 54809.3 1434.3 1.25993e+07 4373.5 6855.37 1.67936e+07 17176.1 7006.3 6.30784e+06 19492.8 17576.4 5771.02 1.67936e+07 14802.5 9795.27 5735.27 1.67936e+07 3972.38 1.67936e+07 46424.3 831500 1.17237e+06 8.17199e+06 3.13663e+07
78188 20231031.34 27969.8 2.30851e+07 0.777414 5602.33 8.59996e+07 14059.1 1.88908e+07 69302.6 14173.3 1.05021e+07 15545.1 1.46964e+07 17118.8 43790 47386.9 54591.4 1434.6 1.05021e+07 4355.1 7223.17 1.67936e+07 17093.8 6938.2 6.30784e+06 17419.8 17431.3 5775.87 1.67936e+07 14898.7 9859.67 5491.97 1.67936e+07 3979.22 1.67936e+07 39990.1 830634 1.18149e+06 8.13241e+06 3.07346e+07
78196 20231101.2 28088.2 2.30851e+07 0.832989 5623.15 8.59996e+07 14070.4 1.88908e+07 88490.7 14239.9 1.05021e+07 15638 1.46964e+07 17212.9 43839.1 47046.4 50979.6 1437.9 1.25993e+07 4393 6871.58 1.88908e+07 17147.3 7054.3 6.30784e+06 19277.1 17624.4 5818.22 1.67936e+07 14959.6 10005.4 5735.09 1.67936e+07 3977.77 1.67936e+07 44220.3 834004 1.18027e+06 8.15222e+06 3.09693e+07
78218 20231101.11 27482.4 2.30851e+07 0.794466 5594.46 8.59996e+07 14033 1.88908e+07 83063.2 14051.8 1.05021e+07 15531.3 1.46964e+07 17267 43523.4 39919.2 54609.1 1428.2 1.25993e+07 4338.1 6867.98 1.67936e+07 17157.6 6933.2 6.30784e+06 18949.1 17376.4 5807.77 1.67936e+07 14871.1 10180.4 5469.02 1.67936e+07 3994.19 1.67936e+07 45431.3 833473 1.18618e+06 8.15072e+06 3.08689e+07
78226 20231101.13 27521.2 2.51822e+07 0.798772 5625.43 8.59996e+07 14043.1 1.88908e+07 73492.7 14097.8 1.05021e+07 15604.3 1.46964e+07 17229.8 43650.8 46528.9 47448.2 1414.9 1.25993e+07 4341.1 7241.73 1.67936e+07 17155.8 6889 6.30784e+06 18953.8 14940.7 5756.54 1.67936e+07 14721.7 10072.6 5445.43 1.67936e+07 3965.05 1.67936e+07 46340.6 835263 1.18362e+06 8.1689e+06 3.06211e+07
78246 20231101.20 27565 2.30851e+07 0.784451 5643.71 8.59996e+07 14099.1 1.88908e+07 70500.2 14165.3 1.05021e+07 15684.7 1.46964e+07 17123.7 45792.5 46974.8 53423.6 1423.7 1.25993e+07 4408.4 7247.5 1.67936e+07 17022.2 6996.2 6.30784e+06 19427.7 15054.6 5794.78 1.67936e+07 14945.9 10275.3 5485.63 1.67936e+07 3992.72 1.67936e+07 45075.5 837584 1.17997e+06 8.17199e+06 3.10982e+07
78261 20231101.25 28224.5 2.51822e+07 0.81842 5612.19 8.59996e+07 14117.8 1.88908e+07 69365.6 14186 1.05021e+07 15647.1 1.25993e+07 17440.2 45894.6 47638.6 53299.1 1436.8 1.25993e+07 4380.3 7264.49 1.67936e+07 17042 7000.4 6.30784e+06 19569.5 17247.3 5797.39 1.67936e+07 14729.7 10279.9 5486.18 1.67936e+07 3994.48 1.67936e+07 43354.3 835866 1.1715e+06 8.14353e+06 3.07998e+07
78284 20231102.4 27902.1 2.30851e+07 0.775601 5607 8.59996e+07 14039.4 1.88908e+07 74128.5 14144.7 1.05021e+07 15534.3 1.46964e+07 17090 43810.2 47171.4 53039.6 1433.6 1.25993e+07 4380.6 6870.67 1.88908e+07 16902.4 7007.8 6.30784e+06 19632.5 14945.6 5753.55 1.67936e+07 14982 10242.7 5431.34 1.67936e+07 3982.9 1.67936e+07 40950.5 830357 1.18333e+06 8.13473e+06 3.08373e+07

beejones/add-unwrap-in-typescript

build_id build_number pi_basic_mt_sgx_cft^ pi_basic_mt_sgx_cft_mem Commit latency factor tpcc_sgx_cft^ tpcc_sgx_cft_mem tpcc_virtual_cft^ pi_basic_mt_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ ls_sgx_cft^ ls_sgx_cft_mem pi_basic_virtual_cft^ pi_ls_sgx_cft^ pi_ls_sgx_cft_mem pi_basic_sgx_cft^ pi_basic_sgx_cft_mem pi_basic_js_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_full_js_virtual_cft^ pi_basic_js_sgx_cft^ pi_basic_js_sgx_cft_mem ls_js_jwt_virtual_cft^ ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem hist_sgx_cft^ ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
78040 20231027.6 27829.8 2.51822e+07 0.836734 5595.78 8.59996e+07 17347.8 78244 43545.8 47190.7 13998 1.88908e+07 53514.6 14151.2 1.05021e+07 15713.7 1.25993e+07 4370.8 16910.1 18963.5 17168.3 14927 1440.1 1.25993e+07 9745.87 6853.38 1.67936e+07 6967.3 6.30784e+06 5823.6 1.67936e+07 5784.87 1.67936e+07 44777.5 4008.2 1.67936e+07 836679 1.18335e+06 8.13509e+06 3.11147e+07
78100 20231030.19 27969.6 2.51822e+07 0.829101 5570.45 8.59996e+07 17320.1 76655 43899.7 47775.1 14016.2 1.88908e+07 54495.5 14140 1.05021e+07 15553.4 1.25993e+07 4425.5 17175.3 20132.9 16943.4 16981 1427.9 1.25993e+07 10177.8 6867.87 1.67936e+07 7095.6 6.30784e+06 5797.92 1.67936e+07 5451.83 1.67936e+07 44777 3965.91 1.67936e+07 833617 1.18434e+06 8.13493e+06 3.07831e+07
78204 20231101.6 28011.7 2.30851e+07 0.785214 5592.96 8.59996e+07 17330 81579.7 43794.1 46910 14047.4 1.88908e+07 54096 14087.8 1.05021e+07 15558.1 1.25993e+07 4349.3 17328.5 19769.1 17425.6 14708.2 1434.5 1.25993e+07 10303.4 7248.19 1.67936e+07 7059 6.30784e+06 5797.15 1.67936e+07 5745.56 1.67936e+07 41968.7 4000.28 1.67936e+07 827305 1.17985e+06 8.1275e+06 3.13601e+07
78288 20231102.5 28272.6 2.30851e+07 0.818781 5600.24 8.59996e+07 17415.3 89214 45657.6 48591.3 14059.8 1.88908e+07 54448.5 14154 1.05021e+07 15674.6 1.46964e+07 4403.8 17225.4 19799.6 15034.7 14887.4 1438 1.25993e+07 10075.2 7250.13 1.67936e+07 6978.5 6.30784e+06 5768.25 1.67936e+07 5735.05 1.67936e+07 44957.5 3976.44 1.67936e+07 834551 1.18174e+06 8.16981e+06 3.06669e+07
78304 20231102.11 27940.2 2.30851e+07 0.808172 5529.96 8.59996e+07 16987.4 79745.8 45660.1 48527.7 14038.9 1.88908e+07 53740.7 14130.9 1.05021e+07 15604.8 1.46964e+07 4374.6 16998.6 19622.8 14785.7 14871.7 1437.9 1.25993e+07 10321 6840.47 1.67936e+07 6924.8 6.30784e+06 5762.45 1.67936e+07 5448.9 1.67936e+07 42240.3 4002.79 1.67936e+07 839212 1.17784e+06 8.14803e+06 3.08308e+07

images

src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
@achamayou
Copy link
Member

@beejones thank you for adding the C++ implementation. It needs testing too, a good starting point is the test for wrapKey:

"/app/wrapKey",

That currently does the unwrapping in Python (which I suggest you leave in), but you could for each variant unwrap with an endpoint calling the new function and make sure the results match.

@achamayou
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
src/js/crypto.cpp Outdated Show resolved Hide resolved
@achamayou
Copy link
Member

@beejones thank you for adding the tests, the PR looks good. There's just one thing: the scrubbing of private keys from the heap isn't quite right and scrubs caller input rather than the temporary copies created inside the call.

src/js/crypto.cpp Outdated Show resolved Hide resolved
@achamayou
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@achamayou
Copy link
Member

/azp run

@achamayou achamayou enabled auto-merge (squash) November 2, 2023 09:22
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@achamayou
Copy link
Member

@beejones can you merge main into your branch please? There's usually a button to do this on the PRs, I am not sure why it doesn't appear on yours.

This is necessary so that the CI runs on what main would contain post-PR-merge, including all recent commits, and is automatically enforced.

@achamayou achamayou enabled auto-merge (squash) November 2, 2023 11:12
@achamayou
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@achamayou achamayou merged commit e759f99 into microsoft:main Nov 2, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants