<div dir="ltr"><div><div><div><div>I'm working on adding the rev32 changes to Noise-C / Noise-Java.  As part of that I'm implementing the "fallback" and "pskN" modifiers as mechanical translations on the base pattern at runtime.<br><br></div><div>While "pskN" is well defined mechanically in rev32, "fallback" is not.  Here's my attempt to make the definition precise:<br></div><div><br></div><div>---Start of definition---<br></div>The "fallback" modifier applies to interactive base patterns that with the following properties:<br></div><div>  * The pre-message must either be empty or "-> s".<br></div><div>  * The first handshake message must consist of a single "e" token.<br>The "fallback" modifier thus applies to "NN", "NX", "XN", "XX", "KN", and "KX".  Applying "fallback" to any other base pattern is an error.<br><br></div><div>The following modifications are applied to the base pattern:<br>  * The "e" token in the first message is moved to the pre-message as either "<- e" or "<- e, s".<br>  * The first message is deleted from the handshake.<br>  * The remaining messages have their directions reversed.<br>  * All "es" tokens are replaced with "se", and all "se" tokens are replaced with "es".</div></div><div><br></div><div>The "fallback" modifier does not commute well with other modifiers: "XXfallback+psk2" is not the same handshake as "XXpsk2+fallback" for example.  "XXfallback+psk0" is valid, but "XXpsk0+fallback" is invalid because the first message is no longer a single "e" token.<br><br></div><div>It is recommended that if the "fallback" modifier is present, then it should be applied before all other modifiers.<br>---End of definition--<br></div><div><br></div><div>The definition could be simplified further by restricting it to "XX" only.  I'm not sure whether things like "NNfallback" and "KXfallback" are useful, but maybe someone can think of a use for them.<br></div><br></div>Comments?<br><br><div><div>Cheers,<br><br></div><div>Rhys.<br><br></div></div></div>