# Could someone please explain test vectors of NIST for RSASSA-PSS 1024 bit?

I am new to RSASSA-PSS Signature verification algorithm. Below are the test vectors from NIST but i am not able to understand each parameter.

I could understand that SHA1 is used for Hashing and e stands for exponent but not other parameters?

Also, Can someone pls provide link of NIST test vectors of RSASSA-PSS with 3072 bit?

Could someone pls explain about what is n,p,q,e,d,Msg,S,SaltVal,EM with hash moved and Result = F(4 - Format of the EM is incorrect - hash moved to left) from below NIST test vector? what this Result parameter actually conveys?

[mod = 1024]
n = ec996bc93e81094436fd5fc2eef511782eb40fe60cc6f27f24bc8728d686537f1caa82cfcfa5c323604b6918d7cd0318d98395c855c7c7ada6fc447f192283cdc81e7291e232336019d4dac12356b93a349883cd2c0a7d2eae9715f1cc6dd657cea5cb2c46ce6468794b326b33f1bff61a00fa72931345ca6768365e1eb906dd
p = f71840f8a6472ebdc7f54d9884e86428ebd368324d87298fa00d9ccfb3d9afc21e0e2a10b15eb4a08f80cca7268a36a762f4900866a6a07419f9543ac3101a8b
q = f520558d02718b19a113fec43f4d086b76bb50e6d83772f1b07131b60a19a2baa553715df82a9e5dece4c79a5388949bcd9cf6a6c8c010903e681e195d3b5937
SHAAlg = SHA1
e = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090c6d3
d = 4333e93f386b41556edcdc7ce6c61445265f52f45b87d17141de1db50c35295bb62443fcf3943708944c7fe14fd4aacf1c5a78c762b7c2d60e884f488303a83ee1dea71e31a2806ee413ae5014cd2049bc164356b0a787678baad03127302e5b0cbd62b18d0b4defa62f203f63aa00f79e784698747318647e8381cec44e27a1
Msg = f0b83b8facf6698d564bad334fe494aba3eea42f3cfc378455a989c4317e0f610c160a67527f5d010fe49b3fa6696516c757f3a99b79f0c641c68bb47e3fcb2cb01b22a5042246d5e9573c74c5d9b543e60b9e4dbbf3f36c44e0d410c750da3cc510abd12ca5cc0fceebb75912fc2e38e953cea30432e77e45408b607377e599
S = 7973359908f1cb2f7eb31e19f7655e8117261e17c43c8ce5b12bb861b541fea168e077b41cf11a95ef7a80edf5f5903987e59d4b9f115cdb3b6394eb0dcb6f5869be0f896087bec612093965ba020449eca36ea74acffe1eb9f42e4ef03247cccbf99557073ad99a144172669e49296980c9aeb5fc7fa64660a680c320edb20d
SaltVal = 2393183e18581e6924cd38f24192d1acc145633a
EM with hash moved = 0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003021300906052b0e03021a050004142f2d655ebb3b3b81c73bb9bf8e420ffa7f7ecc3fefefefefefefefefef
Result = F (4 - Format of the EM is incorrect - hash moved to left )

• p and q are the primes used to generate the modulus N, d is the decryption/signing exponent. Msg is the message, S is the signature. I suppose that's the general idea. Jul 3, 2017 at 5:19
• For verification, I can use the exponent(e) ,Modulus - 1024,Msg and can expect the Signature(S), am i right? what is EM with hash moved? and what s the significance of Result parameter ? Jul 3, 2017 at 5:45

## 1 Answer

In Result = F (4 - Format of the EM is incorrect - hash moved to left ), the first F says that a correct signature verification implementation must Fail to verify the test vector (for known-good vectors, there is Result = P for Pass). What's in parenthesis following F documents the intention in making the test vector, but that's purely informative.

My guess is that this particular one means that the test vector is believed having been generated with the hash field too much on the left, eating some padding. But looking at EM with hash moved value, this clearly contains an EM for RSAES-PKCS1-v1_5 except the PS field is too short and garbage is inserted on the right, and I can't make sense of that in an RSASSA-PSS test suite. But who cares that a test vector expected to fail is nonsense? The point is that it is rejected; test vectors have poor coverage of possible errors in signature verification code anyway.

Update following comment: There are valid Pass test vectors for 3072-bit RSASSA-PSS in the FIPS 186-3 test vectors, file SigVerPSS_186-3.rsp, from which the question seems to be extracted. The mildly hard thing is extracting them out of the ocean of Fail vectors. Towards this, find immediately above some Result = P the values of SaltVal, S (3072-bit), Msg, d, e, SHAAlg; then somewhere above a value of n (3072-bit); check that d, e, n match by verifying that $2^{ed}\bmod n=2$, then forget about d; you have your test vector! Here is one:

n = ce4924ff470fb99d17f66595561a74ded22092d1dc27122ae15ca8cac4bfae11daa9e37a941430dd1b81aaf472f320835ee2fe744c83f1320882a8a02316ceb375f5c4909232bb2c6520b249c88be4f47b8b86fdd93678c69e64f50089e907a5504fdd43f0cad24aaa9e317ef2ecade3b5c1fd31f3c327d70a0e2d4867e6fe3f26272e8b6a3cce17843e359b82eb7a4cad8c42460179cb6c07fa252efaec428fd5cae5208b298b255109026e21272424ec0c52e1e5f72c5ab06f5d2a05e77c193b647ec948bb844e0c2ef1307f53cb800d4f55523d86038bb9e21099a861b6b9bcc969e5dddbdf7171b37d616381b78c3b22ef66510b2765d9617556b175599879d8558100ad90b830e87ad460a22108baa5ed0f2ba9dfc05167f8ab61fc9f8ae01603f9dd5e66ce1e642b604bca9294b57fb7c0d83f054bacf4454c298a272c44bc718f54605b91e0bfafd772aebaf3828846c93018f98e315708d50be8401eb9a8778dcbd0d6db9370860411b004cd37fbb8b5df87edee7aae949fff34607b
SHAAlg = SHA256
e = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073b193
Msg = 0897d40e7c0f2dfc07b0c7fddaf5fd8fcc6af9c1fdc17bebb923d59c9fc43bd402ba39738f0f85f23015f75131f9d650a29b55e2fc9d5ddf07bb8df9fa5a80f1e4634e0b4c5155bf148939b1a4ea29e344a66429c850fcde7336dad616f0039378391abcfafe25ca7bb594057af07faf7a322f7fab01e051c63cc51b39af4d23
S = 8ebed002d4f54de5898a5f2e69d770ed5a5ce1d45ad6dd9ce5f1179d1c46daa4d0394e21a99d803358d9abfd23bb53166394f997b909e675662066324ca1f2b731deba170525c4ee8fa752d2d7f201b10219489f5784e399d916302fd4b7adf88490df876501c46742a93cfb3aaab9602e65d7e60d7c4ceadb7eb67e421d180323a6d38f38b9f999213ebfccc7e04f060fbdb7c210206522b494e199e98c6c24e457f8696644fdcaebc1b9031c818322c29d135e1172fa0fdf7be1007dabcaab4966332e7ea1456b6ce879cd910c9110104fc7d3dcab076f2bd182bb8327a863254570cdf2ab38e0cda31779deaad616e3437ed659d74e5a4e045a70133890b81bc4f24ab6da67a2ee0ce15baba337d091cb5a1c44da690f81145b0252a6549bbb20cd5cc47afec755eb37fed55a9a33d36557424503d805a0a120b76941f4150d89342d7a7fa3a2b08c515e6f68429cf7afd1a3fce0f428351a6f9eda3ab24a7ef591994c21fbf1001f99239e88340f9b359ec72e8a212a1920e6cf993ff848
SaltVal = 00
Result = P


If you find some reference telling if the MGF1 function shall use the hash designated by SHAAlg, or SHA-1, please share it!

• Exactly fgrieu... So i am suppossed to take Result = P test vectors from SigVerPSS_186-3.rsp.... Could you also share the Test vectors of RSASSA-PSS with 3072 bit??? Jul 3, 2017 at 7:18
• @danny: Some Pass test vectors of RSASSA-PSS with 3072 bit are right there in the very file that you quoted, only spread and intermixed with Fail test vectors that have little to do with RSASSA-PSS. I now try to clarify how to make sense out of it.
– fgrieu
Jul 3, 2017 at 10:52