Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for CompressRat (0.12 sec)

  1. src/crypto/internal/mlkem768/mlkem768_test.go

    			ceil := q / (1 << bits)
    			if diff > fieldElement(ceil) {
    				t.Fatalf("decompress(compress(%d, %d), %d) = %d (diff %d, max diff %d)",
    					a, bits, bits, got, diff, ceil)
    			}
    		}
    	}
    }
    
    func CompressRat(x fieldElement, d uint8) uint16 {
    	if x >= q {
    		panic("x out of range")
    	}
    	if d <= 0 || d >= 12 {
    		panic("d out of range")
    	}
    
    	precise := big.NewRat((1<<d)*int64(x), q) // (2ᵈ / q) * x == (2ᵈ * x) / q
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 15:27:18 UTC 2024
    - 10.3K bytes
    - Viewed (0)
Back to top