Hot answers tagged

6

Well, the obvious thing to do is give it a long list of integers of known primality, and see whether the algorithm reports it correctly (with it occasionally reporting a composite as "relatively-prime" not being counted as an error, as long as it reports that value as composite at least 75% of the time). However, that simple-minded test might miss ...


5

This is a good question, but I would consider hardcoding a known good group. There does not seem to be an advantage to letting the server decide if you can afford to use high enough parameter values. The SRP paper lists the following checks: "n is a large safe prime" (this is your first three points) "g is a primitive root of GF(n)" (your next point) "A ...


4

You can (and should) do the reduction in constant time using masking. That is, instead of using the following (non-bitsliced) pseudo-C code to do the reduction: if ((result >> 8) & 1) { /* bit 8 is set: clear it and flip bits 0, 1, 3 and 4 */ result ^= 0x11b; } you can simply do: result ^= 0x11b * ((result >> 8) & 1); ...


3

A recent paper presented at FSE'2016 [1] addresses this exact question. In fact, it even provides a bitsliced implementation for the S-Box you are interested in Section 4. In summary: you first encode the existence of a bitsliced implementation as a SAT problem, use an off-th-shelf SAT-solver to solve it and finally retrieve the bitsliced encoding from the ...


1

Find other software that does the test, then compare over the first 10^10 or more integers, then over random large numbers (both inside 64-bit range and significantly larger assuming your software does that). Try various bases. Use the Feitsma-Galway database of all 64-bit base 2 strong pseudoprimes and make sure you produce a similar results for all those ...


1

So, I does anybody know how to design a module for remainder operation in >verilog that computes the remainder in a single clock cycle? Any links to >literature discussing the algorithm would suffice. A nieve implementation would be something like. parameter bitwidth; input [bitwidth-1:0] a; input [bitwidth-1:0] b; output reg [bitwidth-1:0] result; reg ...


1

Try to generate the Algebraic Normal Form (ANF) from the sbox step by step (i.e., with 2 bits and so on) or use something like http://cis.sjtu.edu.cn/index.php/A_Simple_Python_Script_for_Translating_Sbox_to_ANF_Boolean_Functions



Only top voted, non community-wiki answers of a minimum length are eligible