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

ML-DSA SigGen AFT pass after reversal of "rnd" #331

Open
mwcw opened this issue Apr 29, 2024 · 6 comments
Open

ML-DSA SigGen AFT pass after reversal of "rnd" #331

mwcw opened this issue Apr 29, 2024 · 6 comments

Comments

@mwcw
Copy link

mwcw commented Apr 29, 2024

environment
demo

508242

vsId
2313302

Algorithm registration

{
    "isSample": true,
    "algorithms": [
      {
        "mode": "sigGen",
        "deterministic": [
          false
        ],
        "parameterSets": [
          "ML-DSA-44",
          "ML-DSA-65",
          "ML-DSA-87"
        ],
        "algorithm": "ML-DSA",
        "revision": "FIPS204"
      }
    ]
  }

Endpoint in which the error is experienced
demo

Expected behaviour
pass without need to reverse supplied "rnd"

Additional context

For "deterministic=false" mode the ACVP supplies a "rnd" value, we take this "rnd" value and initialise a dummy entropy source that exposes as an entropy stream the values that it was initialised with in order, ie the first byte out will be byte[0] of the RND array.

Without reversing the "rnd" array I cannot get the AFT tests to pass, when the array is reversed the AFT tests in sigGen pass.

Secondary issue that may not be related:
At this stage I cannot get SigGen GDT tests to pass but our verifier can verify both our GDT results and the sample value.

Vectors attached.

Please let me know if you need any more information.

ml-dsa.zip

@celic
Copy link
Collaborator

celic commented May 1, 2024

Would you mind checking this test case produces the listed signature on your implementation? I reversed how the rnd value was used to account for the endianness difference. I'd like to confirm this fix before wrapping it up into a release.

    {
      "tgId": 8,
      "testType": "AFT",
      "parameterSet": "ML-DSA-44",
      "deterministic": false,
      "tests": [
        {
          "tcId": 71,
          "deferred": false,
          "sk": "708DFB9AC32DE6C40E602E5DEEDDD3D232613E513C369B40E896410DC4950D46D01BC9170E3ABD826F3F125C4571FC8F92AD5E89EE4352948181965B32A87A4C731FADF1DFB7CA70A3C5205CD799F6585CE416587DDE9AE6EC1281B6956C9E5A5BBD8866DB4E2B909B463D479C12F2103B83130B7CE32005817D9DE9863E9D9AC934690A0662E1C4204234120C85500B078A9938611111445222418B2840CCA0211C3360221345D0162A24418A61C81051204D12497243488D10372524400051962C22982C48965019202C91B489093224D2344D640448D2360A82C22C42C0315A902462C0681432891A352E6442505A986463881053384510203014958824A009E3104D80462410185148140D1119049120485A244E1925064142800108701B352544C004812088E23282103008C2840C02172D4186514C368D211642E3328D1A458048C2088A268E14C92181146D1C442A8A40848BA26010214C123485A0A64450346A14026948060E22C961E1B0245092505B228A2233920091091B14062421220B188C0C810C19B2499B228A21064E8A426A53922089A82858202E0806701A822121416862A248002091D1A40CE436849A204C0B8049D1362A80004944020E810420C2C41163A88C8B947008118063B649A0A0405CB08C138181DA081213A54C9426659B424060C4019B020418B94593C00500C36D09222DCA1461D9008C0983711C216A09B04C1384314C048D19A32D59C0081BC22911340621302950122590B84C02C72D53A6281B106101024099140AA18280D440701C1520D0903102109190A6410CB40123056624330D18A444CCA4700824400B492A08B6095990205A06910BC88C04324509106509846DC9302AD000222420014BA22D5B26449902880220315B006E201681D4A8481A44099C108C0A996821A200534068D9108960381208348440328050C2049C4848A2244E14004558047214495150368699108D61C460E1988C1C43651A434C60484C1190895C328A8A4882C33672A4986118478A22260C22154DC2360CD1326E13C20054A64148122258101201391241340064A02C4A820963368E43201090449141A06988268D1C0180220749A10271E0A485210912E1460608322E089620DA8204CB1662D8824480928880A82CA08488D9822C49184A0C258581C024440220C3A80914922DDA922509406A990292C3B20D0A49245C262400377144448408233240884DC1B06C09A13010064AD1186113909136188E3AA795CC5E458B50B11C0DDF3452B7CFF378A6265A49519EBA9A866A3E8C420248A168F2FEB8117C07CF29B724C75F360165DD761B6316872702DDF9D2DFFE8648431818C9F2A80C38725E36F50ABD09C3C9DCD84B95C686B856C94BAEA0DCD9F2B120DC3244818BA6831CB88F64E75674683398718C0B908A7A48699B6B471D30627ABEFC7F9A76E4CA861650E15287B164AA4E1621069FA7FCF7756E2DBA076405ABFF691C16FC72364E7BF9561D15C016B3F16476EEAF7FE4DE66DA97569A21371296E79C36588C78F29B862D3B679FC3EC6A8B9EBEB17ED41516083CF808279BE986CCCFCF998F0B9F4BC633769C0A17E4A3561EBEDE6B4E179ECB95C2244BC364171938D7570402416E3B3943F5B2BBBE136EB093593E578A87CAB820BF05A204EB24A45088B54CCA32F01A7AC51767B41BEF259E3C3F8023B5712BB0064CCC19D044E90F71CFB5795E754A390CB2ADB480A16250F179EA9751A817FC855601A87758FE2CA617D9876B612B0EE2B8DDD3D888B88C5F464AD016BE4F9A1F95390F9F504677BB52A8714A31005C650D29A93E92FEF4C6E7FAF25BA2133BE7114E2DDD8BDABAADB313289193F39331389368502E97DFBE264FB09196DD364A7D251EB9C4BE3BC9335A1EF4D2F1AEA9442A4A9DF9440C01E1F8C16AE038F9BCF11E3A10AB095668B253074AA9AC9245C816F1219CF741EFC125EA3462238022DCD9E0703AE8A2A30D8052AD1C9337CE62FD769089853D04E8FDD1153C6EDD3657B8001A9322420BD60912EF332D5A659C0A9B2046C03D2B08E160AB0B5FC72D96EA00CFD7ACF3632C2B0577715042C834E229B87BD8C37F39E672FD88EFF82BA8199C5FDF5A01187C88D691D22D17DA29E5868D1EA4B3D60AE095312A2CBF27CA71BCBD67D42C88D6D7C6780FD4289952A2290DFA3CC461227E5877FE1DF74722DF07B83B5CB6E56B5D3E594E92FAFDB8FCADB81C8EAD80DC5EE725AC1B325BF54238B2E9D4E5E5867437366EC45F311454A84B511AB46AB2CF17F05A197F6FF9CCF30747F940FE07676FF5CA57C58393F2115608C32B31D7306577D139A1FB3524436B78E5D0A6CC3612E9A23C6DD09470AA0C03DE31DE6D1B78C09AEEA1A206A7A748E6B0BCD551AA838398F26D64694011AB73FF6FDC4A1BA6CA405A6325544FF8C8CFAB53855FCB41A316C4DB0C6A027E5B916D4F767077F51DC26A5DCD355474B0010B7B9C6A05D994F7CD3CC8761C222E5E1F2748D60A00FBA883F0C6F7569BC6D7946ED1D6E7680A5674FBBD90E8820AA6D89E9B17484981D2FDF04FAA6DB50DD3FA1353D73283AEAA68D2554E2E2A0E08350E9D4283ECF1CE143DECBFD31755FF56FCA4A0B79FF375FFD86B92065C9190B04F50876873BB077DD92FD2AE466694479D90B8E7C335DE0DF79715D694EE3672247739BE5BF1477A70431730F1A8613B8949E34E12BC9DCE72275272B94535FECD873FCE0B93E4CF4E1AD3792E16526C8F081B78E524A18390FFE06DCCB785BFA623F4D1E31682A0F887A7C9F9EFDF8E1B43A13FAF8B90C92233D568C8B89CD42BCB4EA1FFD6A7E1B23015D22893CB8D59087149781957F8ADAC501E6F9CE5D30E1286CA4F5C4AF9B93EDFE01234F9792F73C3491CF15B1E80236EB13652C738F1187C5F7FE6A0EA34A159B8941FE2358FE3264D1B0E54B0088BE3CDC6E287A85E74085725FA350F83EDC0DE40016AAAAF006FBF7A2BB0743FF57234BB839C9B48F9B33F41D952413353694C9274EA35708D68225A8E9809E64FB45F3BEF73FB65467EE6B70964E070FAE352BD534932DA47A78E25FD419C20441F4D37D10FABA9A5281773AACA92C11BF919BD2C9B784EE039E7604C56953D1EB23212F52B316E65B497D8695A6A56040F35533F5B85E61807FADB1FBA122E2368AFBE58E604CD806FD818A9786DC9EE94841069AB6826C754DD5607980AF25251462D38C227FDEF51B6C706A850FFBE6D2EA17769FEFADA34F92191B756D4F6B83056DD05F1B0DC84430966E6FB4A13D309AC72780873BD4A33713C8230E0E00695AEAED47DC238100713E7F9B13A49679602BA0B8E650DCF40DF9773155C6DF5350FADCCBEA304AEF40780FD729E347A8AAA10C7AAB374D7AC4BA64CB923F8E8BFCC3BCC0B656C51374599EDB5FC92DFB6A0D7B8306E0D18DAF85193759CA6A124294945FEC8C6CE8BE3BDFAFA7744C200D2F64975F2BFD6C85D74F0CAD82FDF4B1A676B1388D9FFA2A587976B1AAC94339169EC5BC1FFC2DCF8A6DFA47FC00893E739C0A55813DA5B82D6EEAB3D54B1FC04DE3247EE7F97796969F8408EB4B7484C5FB51D110F3657A9D4C5",
          "message": "8848EFB48DA007263A6249636E3755939C4439FAF4903B47B58607ED50A767A4D3FE7F90C63DFB86DE9BE452469CF189405468C1A7133607D9B6F18826E5C21EB490FF5FC195E80405E10E2A9814FDA70F2DD312C51C34D35D4026AF420167EDC57C67434300B713672EDDDBE79348006533898ED3889B1CD3435F78A95033E2",
          "rnd": "5800F966E6296D045A7090483B33A0B74CE3A75317FEE76A825204C05A034037",
          "signature": "69F6471F76967E43C080FC995AC073E9D2A2B49E73C9E8A3799FD1F60254429E071C04367314B664273D2020653FAC16B7CA8C668AF77219EB491FBB42ADE6A384EC75318ACFB522B32241DED8B24C69FB944607F7EAD3DEA2EB0DC07BD565A4A727692AAD190D46DB50E47ECEDC6754BCAB18E678EDEE756203F7B5795A579E8CFEB0F2857273CCD14FDFF3419551B3994EA3783DFF0CC3F74C8D3AFC56F9207B53682906954D589C2563E3B1DBAB41A569DA2AC378390BADCDA807AAED6FFE950219B1AB26FC8D922D569848D0248A0CD8AEFF6213F3AC95C3D9612580B64833BAA5BD6E38B4ED329A23D02234FCC9FE53380F7D2543597D2372572835087C236CD2550176793F58E0C1C16C63DFE19D0373B8C0B5D0AC5F9715225957BB6E488DF0A71135368A9986A2AE5049DEF2307E43774E14F3A3F6CAEBB3BCB198B524ED4095C39757A3CFB13FA5C9A1E361D5F2AD1A5489F8E81DD057CF6B133F31578259BC7509A9BDDB19BBC6080E716B9C20F83F0AA1E23F3338DBA6BB531BC042D88EA08B1B7A64C162690D8E8B92A186419A49BB34F58657989C8A9B2FD233374D9EC99739A5C44ABEF00263F95E61D85352C97AD6C144D89C52C042B28BFEB758A6A288A13FDFDF68963921AD5061279E299E92F90B54C724788F5BE5FFB9806FE3E741056548C540EF02BF552EC7F6C0F06433D0FE2F53C543C0B87D02BA872EA85EFC2B3AE56D30AB5533C4C2B9F306CB0D4BC9BFD7CAE934F2866C5EF68398D7DBC619A9EA9E2424827BDD80BA8856DC5AD7BC226D0E82612B7D0AEFFBA285E92D30772C4918DDD85B2C70D4A1442B08D7219CB43FF1843472CCB4171EB71F4FC9516BDAB80748BAED19EDF4E673898E40D6ED8571A593550455454B0DCF012DA3EE7A2F25E6BB24E9F2228E6D08413BCD9527B44B8A2A945085DD4DED2AEA1AEEA522B6946DD5A077CB2727880040D5C9C99CA8961B4493B1A7DE9276B07CECB5F368BDD8F9BA7A16A99C402C53118DEABA43BF294731D1C0BA50B069D8EE1EA2E2EC88BEBA38C6FC5EB62339EA8507F72234AFEB785E5EEA4F0256AC6E242083A9CC6A9A3550E473097FE7463D351D2BA7E2B348DB48854D5D788D49B37618793FD95D6AF63512A7CE3CE54312AD4173919234E6300E13EE2844A1310A15C9D715213ACFE9123446DF6C32BA73001E23D8E5A545CD23221FDA13352342E98C69902D313EB81311975E3EC51625A360CA12AD86328D59076D84091195B98A3C75ADC55C60CE47A77DCC637D3BD775D99706BC46DA96363C02457E6DB59AB7C53E5701F991BF15B79814D80346920756DF75AB61E3AEA1F1790AE5D6EF59ED1094B2F0788CE50EBA38350E6A549E973D7249FE4D1A6B70991F88AE8BEBCFF76C6D041E937FD4EAED0C30CEA04A956F561D19C5A46B0FFBC710396E2692970ED979022F903A40786618425C3E3B6273D7126F8F7807E2E78A5C4A1DE515226F0F8DC6D8CEC958FE1D98F3C098AD22CD769D3704919F26E435BF8E022287B2DD113E196EAB34B96464705F3737BCFC5A3F86A3C66F51E9EECF52AA4C0BDA552897FE33132A829CAD1FB6E967ED928F476A9D19FBEB53DA0577619542DD78CC6FCCEB37D4D356C6C4A9DB489272EAD897231AFB392874EBC3F72B20AD643E68F7ECC52FFEB8A57FD036AFCFA2AED51F37ADDF2E6B86C838B8BC7C2993443563359ED12724F55FB5B1FBA021E4B3E9E092670132BFF6B64BF509A0BC6F8545C9E613B554E2F3B968616EA5FB658F362985AD51EF754D09F0F3E1E0578D1C4347A1A06F76E1E0BC088EDFDD194629631CE28425CE1F1D7823E87478CB80066BCEECFA632AB209A2BBED9A05508E2F29B4BF6D3FEA2EB25BE66491C9DB00BC4F312659B17A1E9CD324A130B31DD70C183B4A4468E8E19576EB2351E9E03E999CF10030A2E9404B91267364098158127F40EFF6F47B3D4412B0330D08B18C395828556DE051C6604E40CA68E1CEC8CF4D8FBF16FB427BCE6C974AA1001E79870DF07F0C116B24B5D348B54A7A3A3A050786A711882EF2C5966C0712264DE0BE5777FABAC77873969CACFADC76D78D19BE235CB7F77012599847D7B6DD065F1698BA2CA851B58538C78EA7DC1F098EE380158D6B2041F0494A58D27A3831F432BC067CB834906B8D37C67E8D9881E0C2625336D30B58F005CC9A3EC95EBB1B01C98B1FD08A2FEF5190F0F19F2CF7EEE77B13182C27050B5E82355F0CB72EA3D63E1CE42720218878540C300D5BA606BCA8DFF1F0202D54BD2E2530D83D33E83CCE7B220B39EB4D6EC42D725A3FEC5D567604CAB8B873918BC359E12352118DF748D28B37B95840F80C6351FD709CD63019BD9D35ABD061CDD80E4124418E66EC0628DB9F50B52A133D3DBEF2A93EC5D49AF4B8B1E80B73186EE6103096948786E970D55A1038C5D8A0FDCE7DD14D97CDF9AA27DFFF6DF42DC4DCB821DDD7926D396AD85E9368C17430ED50E2986E4B2707B054564EAE775CE424BAE587E623955F27415C4D30ED6167066FC2F222C28CFFFF1729A51174ED90A0F713D34B458DF5A441782D08194852F55F60D5294F0AA48EBCD09EAA73185F678E7C6FF6F88E27730CC803BC090F38DF2C1EAA0AF738C9B8C005B7EAC7E6D98093DF51C7978D6ED6EDC10B91387F4D1FF3CE455374D82CF7BABD45AB5FEC32A5628EED2A9A9DD4C9515CC0C7E84D9CB595C942EF3E1374C3BFCBD95963C12536B170735274CF359DF4069770ECF2DC27D98A083C2994E79E93F81A493AD6DC5DFBABAAB47EEDE218BFC84EF79163B637F9CA2B7AE75686E34D3C18D4A1BDCC21C002C8A602FB02B45925FE8035B203576499D6293E9325A28C92CAC6069848BC24A984F19EAE24C8860D6BC94597B38C799710C01010A1D323F6ED33C001E1E0DF0A323A02F2C82D626347F82C9F6FB00F9C387195CE59CD10AE370E18C93BB2FA11BFAB998AA1B0B4D8151D23B806B7EC71FB1901484C41088E5221DA4204B89516B80BC86609634395305BA6DB6021E7CABD9B8D05E62AC75147618292246B94AF50C67CAAFF8DD5DF8FA806BBF7CF228E2568441C7C0159C2A9805401D5DC99A54C2125BE4506F1717C4787BB7005CF971CD9C911BE91291F1DC7B2DF2508C5F8DCC89B85EC2BB4C279E6005174629625946B30BB0F6ADFE094F33B10F18DCE31BB6527520EA262B3710CFD1780D65D60BD8FFD72C3A47D08069D814D0740616154C3CA5275A1CAD43FD3D102CBA5BDD2E34C5993E87F3DE1489E94B514BD0BD1098CCD6E193477797C9BADD6D9E1E80B224247494D555B6E777E8B93ADC5C7D0D8D9DDE70E101718212A2C5457596366A0A8B0C6CED2D3E8172F4145475A79B4C8CBE2E600000000000000000000000000000000000A1F333F"
        }
      ]
    }

@smuellerDD
Copy link

smuellerDD commented May 1, 2024 via email

@mwcw
Copy link
Author

mwcw commented May 1, 2024

Hi,

I got agreement on the signature as well.

Thanks!

@crypto4a
Copy link

crypto4a commented May 8, 2024

Hello,

I also was having issues with this and the reversed rnd[ ] vector yielded the given signature value for me too.

Take care.

Jim

@celic
Copy link
Collaborator

celic commented May 9, 2024

Thanks for confirming. For further updates, see #332. We may try to get a deployment out to Demo with these fixes within a week.

@livebe01
Copy link
Collaborator

The fix for this issue was deployed to the Demo environment as part of today's hotfix deployment.

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

No branches or pull requests

5 participants