Alice and Bob how to know whose number is bigger without giving away their own's

Definiteness: Suppose Alice has number $i$ and Bob has number $j$ and $1\leq i,j \leq 9$. We need a protocol for them to decide whether $i < j$ in the end(aside from their own values) Solution: Let $M$ be the set of all $N$-bit nonnegative integers Let $Q_N$ be the set of all one-one and onto function from $M$ to $M$ Alice generates a public key from $Q_N$, called $E_a$, and the inverse function of $E_a$ is $D_a$ Bob picks a random value $x \in M$, compute $k = E_a(x)$, then send $k - j$ to Alice Alice computes $y_u=D_a(k - j + u)$ for $u = 1,2,\dots,9$ Alice generates a random prime $p$ of $N/2$-bit, and computes $z_u=y_u(\mod p)$ for all $u$....

January 14, 2022 · 1 min · mobilephone724

APUE/Chapter3: file and I/O

The functions described in this chapter are often referred to as unbuffered I/O(which each read or write invokes a system call in the kernel), in contrast to the standard I/O routines File Descriptors To the kernel, all open files are referred to by file descriptors. A file descriptor is a non-negative integer. When we open an existing file or create a new file, the kernel returns a file descriptor to the process....

January 14, 2022 · 13 min · mobilephone724

cublasDgemm

concept cublasDgemm is a convenient function in cublas to compute the product of two matrix, while letter ‘D’ in cublasDgemm means double. Before reading this post, basic cuda functions like cudaMalloc are what you are supposed to know. basic use Definition of this function cublasStatus_t cublasDgemm(cublasHandle_t handle, cublasOperation_t transa, cublasOperation_t transb, int m, int n, int k, const double *alpha, const double *A, int lda, const double *B, int ldb, const double *beta, double *C, int ldc) Basic information of parameters is show in this page....

3 min · mobilephone724