# ACE Encrypt

ACE (Advanced Cryptographic Engine) — the collection of units, implementing both a public key encryption scheme and a digital signature scheme. Corresponding names for these schemes — «ACE Encrypt» and «ACE Sign». Schemes are based on Cramer-Shoup public key encryption scheme and Cramer-Shoup signature scheme. Introduced variants of these schemes are intended to achieve a good balance between performance and security of the whole encryption system.

## Authors

All the algorithms, implemented in ACE are based on algorithms developed by Victor Shoup and Ronald Cramer. The full algorithms specification is written by Victor Shoup. Implementation of algorithms is done by Thomas Schweinberger and Mehdi Nassehi, its supporting and maintaining is done by Victor Shoup. Thomas Schweinberger participated in construction of ACE specification document and also wrote a user manual.

Ronald Cramer currently stays in the university of Aarhus, Denmark. He worked on the project of ACE Encrypt while his staying in ETH in Zürich, Switzerland.

Mehdi Nassehi and Thomas Schweinberger worked on ACE project in the IBM research lab in Zürich, Switzerland.
Victor Shoup works in the IBM research lab in Zürich, Switzerland.

## Security

The encryption scheme in ACE can be proven secure under reasonable and natural intractability assumptions. These four assumptions are:

• The Decisional Diffie-Hellman (DDH) assumption
• Strong RSA assumption
• SHA-1 second preimage collision resistance
• MARS sum/counter mode pseudo-randomness

## Basic Terminology and Notation

### Basic mathematical notation

${\displaystyle Z\,}$ — The set of integers.
${\displaystyle F_{2}[T]\,}$ — The set of univariate polynomials with coefficients in the finite field ${\displaystyle F_{2}\,}$ of cardinality 2.
${\displaystyle Aremn\,}$ — integer ${\displaystyle r\in \left\{0,...,n-1\right\}}$ such that ${\displaystyle A\equiv r(modn)}$ for integer ${\displaystyle n>0\,}$ and ${\displaystyle A\in Z\,}$.
${\displaystyle Aremf\,}$ — polynomial ${\displaystyle r\in F_{2}[T]}$ with ${\displaystyle deg(r) such that ${\displaystyle A\equiv r(modf)}$ with ${\displaystyle A,f\in F_{2}[T],f\neq 0\,}$.

### Basic string notation

${\displaystyle A^{\ast }\,}$ — The set of all strings.
${\displaystyle A^{n}\,}$ — The set of all strings with length n.
For ${\displaystyle x\in A^{\ast }L(x)}$ — length of string ${\displaystyle x\,}$. The string of length zero is denoted ${\displaystyle \lambda _{A}\,}$.
For ${\displaystyle x,y\in A^{\ast }}$ ${\displaystyle x||y\,}$ — the result of ${\displaystyle x\,}$ and ${\displaystyle y\,}$ concatenation.

### Bits, Bytes, Words

${\displaystyle b{\stackrel {\mathrm {def} }{=}}\left\{0,1\right\}}$ — The set of bits.
Let us take all sets of form ${\displaystyle b,b^{n_{1}},(b^{n_{1}})^{n_{2}},...}$. For such a set A we define the "zero element":

${\displaystyle 0_{b}{\stackrel {\mathrm {def} }{=}}0\in b}$;
${\displaystyle 0_{A^{n}}{\stackrel {\mathrm {def} }{=}}(0_{A},...,0_{A})\in A^{n}}$ for ${\displaystyle n>0\,}$.

We define ${\displaystyle B{\stackrel {\mathrm {def} }{=}}b^{8}}$ as a set of bytes, and ${\displaystyle W{\stackrel {\mathrm {def} }{=}}b^{32}}$ as a set of words.

For ${\displaystyle x\in A^{\ast }\,}$ with ${\displaystyle A\in \left\{b,B,W\right\}\,}$ and ${\displaystyle l>0\,}$ we define a padding operator:

${\displaystyle pad_{l}(x){\stackrel {\mathrm {def} }{=}}{\begin{cases}x,&L(x)\geq l\\x||0_{A^{l-L(x)}},&L(x).

### Conversion operator

Conversion operator ${\displaystyle I_{src}^{dst}:src\rightarrow dst}$ makes a conversion between elements ${\displaystyle Z,F_{2}[T],b^{\ast },B^{\ast },W^{\ast }}$.

## Encryption Scheme

### Encryption Key Pair

The encryption scheme employs two key types:
ACE public key: ${\displaystyle (P,q,g_{1},g_{2},c,d,h_{1},h_{2},k_{1},k_{2})\,}$.
ACE private key: ${\displaystyle (w,x,y,z_{1},z_{2})\,}$.
For a given size parameter m ${\displaystyle m\,}$, such that ${\displaystyle 1024\leq m\leq 16384}$, key components are defined as:
${\displaystyle q\,}$ — a 256-bit prime number.
${\displaystyle P\,}$ — a m-bit prime number, such that ${\displaystyle P\equiv 1(modq)}$.
${\displaystyle g_{1},g_{2},c,d,h_{1},h_{2}\,}$ — elements ${\displaystyle \left\{1,...,P-1\right\}}$ (whose multiplicative order modulo ${\displaystyle P\,}$ divides ${\displaystyle q\,}$).
${\displaystyle w,x,y,z_{1},z_{2}\,}$ — elements ${\displaystyle \left\{0,...,q-1\right\}}$.
${\displaystyle k_{1},k_{2}\,}$ — elements ${\displaystyle B^{\ast }}$ with ${\displaystyle L(k_{1})=20l^{\prime }+64}$ and ${\displaystyle L(k_{2})=32\left\lceil l/16\right\rceil +40}$, where ${\displaystyle l=\left\lceil m/8\right\rceil }$ and ${\displaystyle l^{\prime }=L_{b}(\left\lceil (2\left\lceil l/4\right\rceil +4)/16\right\rceil )}$.

### Key Generation

Algorithm. Key Generation for ACE encryption scheme.
Input: a size parameter m ${\displaystyle m\,}$, such that ${\displaystyle 1024\leq m\leq 16384}$.
Output: a public/private key pair.

1. Generate a random prime ${\displaystyle q\,}$, such that ${\displaystyle 2^{255}.
2. Generate a random prime ${\displaystyle P\,}$, ${\displaystyle 2^{m-1}, such that ${\displaystyle P\equiv 1(modq)}$.
3. Generate a random integer ${\displaystyle g_{1}\in \left\{2,...,P-1\right\}}$, such that ${\displaystyle g_{1}^{q}\equiv 1(modP)}$.
4. Generate random integers ${\displaystyle w\in \left\{1,...,q-1\right\}}$ and ${\displaystyle x,y,z_{1},z_{2}\in \left\{0,...,q-1\right\}}$
5. Compute the following integers in ${\displaystyle \left\{1,...,P-1\right\}}$:
${\displaystyle g_{2}\leftarrow g_{1}^{w}remP}$,
${\displaystyle c\leftarrow g_{1}^{x}remP}$,
${\displaystyle d\leftarrow g_{1}^{y}remP}$,
${\displaystyle h_{1}\leftarrow g_{1}^{z_{1}}remP}$,
${\displaystyle h_{2}\leftarrow g_{1}^{z_{2}}remP}$.
6. Generate random byte strings ${\displaystyle k_{1}\in B^{20l^{\prime }+64}}$ and ${\displaystyle k_{2}\in B^{2\left\lceil l/16\right\rceil +40}}$, where ${\displaystyle l=L_{B}(P)\,}$ and ${\displaystyle l^{\prime }=L_{B}(\left\lceil (2\left\lceil l/4\right\rceil +4)/16\right\rceil )}$.
7. Return the public key/private key pair
${\displaystyle ((P,q,g_{1},g_{2},c,d,h_{1},h_{2},k_{1},k_{2}),(w,x,y,z_{1},z_{2}))\,}$

### Ciphertext Representation

A ciphertext of the ACE encryption scheme has the form

${\displaystyle (s,u_{1},u_{2},v,e)\,}$,

where the components are defined as:
${\displaystyle u_{1},u_{2},v\,}$ — integers from ${\displaystyle \left\{1,...,P-1\right\}}$ (whose multiplicative order modulo ${\displaystyle P\,}$ divides ${\displaystyle q\,}$).
${\displaystyle s\,}$ — element ${\displaystyle W^{4}\,}$.
${\displaystyle e\,}$ — element ${\displaystyle B^{\ast }\,}$.
${\displaystyle s,u_{1},u_{2},v\,}$ we call the preamble, and ${\displaystyle e\,}$ — the cryptogram. If a cleartext is a string consisting of ${\displaystyle l\,}$ байт, then the length of ${\displaystyle e\,}$ is equal to ${\displaystyle l+16\left\lceil l/1024\right\rceil }$.
We need to introduce the function ${\displaystyle CEncode\,}$, which maps a ciphertext to its byte-string

representation, and the corresponding inverse function ${\displaystyle CDecode\,}$. For the integer ${\displaystyle l>0\,}$, word string ${\displaystyle s\in W^{4}}$, integers ${\displaystyle 0\leq u_{1},u_{2},v<256^{l}}$, and byte string ${\displaystyle e\in B^{\ast }}$,

${\displaystyle CEncode(l,s,u_{1},u_{2},v,e){\stackrel {\mathrm {def} }{=}}I_{W^{\ast }}^{B^{\ast }}(s)||pad_{l}(I_{Z}^{B^{\ast }}(u_{1}))||pad_{l}(I_{Z}^{B^{\ast }}(u_{2}))||pad_{l}(I_{Z}^{B^{\ast }}(v))||e\in B^{\ast }}$.

For integer ${\displaystyle l>0\,}$, byte string ${\displaystyle \psi \in B^{\ast }}$, such that ${\displaystyle L(\psi )\geq 3l+16}$,

${\displaystyle CDecode(l,\psi ){\stackrel {\mathrm {def} }{=}}(I_{B^{\ast }}^{W^{\ast }}({\Bigl [}\psi {\Bigr ]}_{0}^{16}),I_{B^{\ast }}^{Z}({\Bigl [}\psi {\Bigr ]}_{16}^{16+l}),I_{B^{\ast }}^{Z}({\Bigl [}\psi {\Bigr ]}_{16+l}^{16+2l}),I_{B^{\ast }}^{Z}({\Bigl [}\psi {\Bigr ]}_{16+2l}^{16+3l}),{\Bigl [}\psi {\Bigr ]}_{16+3l}^{L(\psi )})\in W^{4}\times Z\times Z\times Z\times B^{\ast }}$.

### Encryption Process

Algorithm. ACE asymmetric encryption operation.
input: public key ${\displaystyle (P,q,g_{1},g_{2},c,d,h_{1},h_{2},k_{1},k_{2})\,}$ and byte string ${\displaystyle M\in B^{\ast }\,}$.
Output: byte string — ciphertext ${\displaystyle \psi \ }$ of ${\displaystyle M\,}$.

1. Generate ${\displaystyle r\in \left\{0,...,q-1\right\}}$ at random.
2. Generate the ciphertext preamble:
1. Generate ${\displaystyle s\in W^{4}\,}$ at random.
2. Compute ${\displaystyle u_{1}\leftarrow g_{1}^{r}remP}$, ${\displaystyle u_{2}\leftarrow g_{2}^{r}remP}$.
3. Compute ${\displaystyle \alpha \ \leftarrow UOWHash^{\prime }(k_{1},L_{B}(P),s,u_{1},u_{2})\in Z\,}$; note that ${\displaystyle 0<\alpha \ <2^{160}\,}$.
4. Compute ${\displaystyle v\leftarrow c^{r}d^{\alpha \ r}remP\,}$.
3. Compute the key for the symmetric encryption operation:
1. ${\displaystyle {\tilde {h_{1}}}\leftarrow h_{1}^{r}remP}$, ${\displaystyle {\tilde {h_{2}}}\leftarrow h_{2}^{r}remP}$.
2. Compute ${\displaystyle k\leftarrow ESHash(k,L_{B}(P),s,u_{1},u_{2},{\tilde {h_{1}}},{\tilde {h_{2}}})\in W^{8}\,}$.
4. Compute cryptogram ${\displaystyle e\leftarrow SEnc(k,s,1024,M)}$.
5. Encode the ciphertext:
${\displaystyle \psi \ \leftarrow CEncode(L_{B}(P),s,u_{1},u_{2},v,e)}$.
6. Return ${\displaystyle \psi \ }$.

Before starting off the symmetric encryption process, the input message ${\displaystyle M\in B^{\ast }\,}$ is divided into blocks ${\displaystyle M_{1},...,M_{t}\,}$, where each of the block, possibly except the last one, is of 1024 bytes. Each block is encrypted by the stream cipher. For each encrypted block ${\displaystyle E_{i}\,}$ 16-byte message authentication code is computed. We get the cryptogram

${\displaystyle e=E_{1}||C_{1}||...||E_{t}||C_{t}\,}$.${\displaystyle L(e)=L(M)+16\left\lceil L(M)/m\right\rceil }$.

Note that if ${\displaystyle L(M)=0\,}$, then ${\displaystyle L(e)=0\,}$.

Algorithm. ACE asymmetric encryption process.
Input: ${\displaystyle (k,s,M,m)\in W^{8}\times W^{4}\times Z\times B^{\ast }\,}$ ${\displaystyle m>0\,}$
Output: ${\displaystyle e\in B^{l}}$, ${\displaystyle l=L(M)+16\left\lceil L(N)/m\right\rceil }$.

1. If ${\displaystyle M=\lambda _{B}\,}$, then return ${\displaystyle \lambda _{B}\,}$.
2. Initialize a pseudo-random generator state:
${\displaystyle genState\leftarrow InitGen(k,s)\in GenState}$
3. Generate the key ${\displaystyle k_{AXU}AXUHash\,}$:
${\displaystyle (k_{AXU},genState)\leftarrow GenWords((5L_{b}(\left\lceil m/64\right\rceil )+24),genState).}$.
4. ${\displaystyle e\leftarrow \lambda _{B},i\leftarrow 0}$.
5. While ${\displaystyle i, do the following:
1. ${\displaystyle r\leftarrow min(L(M)-i,m)}$.
2. Generate mask values for the encryption and MAC:
1. ${\displaystyle (mask_{m},genState)\leftarrow GenWords(4,genState)}$.
2. ${\displaystyle (mask_{e},genState)\leftarrow GenWords(r,genState)}$.
3. Encrypt the plaintext: ${\displaystyle enc\leftarrow {\Bigl [}M{\Bigr ]}_{i}^{i+r}\oplus mask_{e}}$.
4. Generate the message authentication code:
1. If ${\displaystyle i+r=L(M)\,}$, then ${\displaystyle lastBlock\leftarrow 1}$; else ${\displaystyle lastBlock\leftarrow 0}$.
2. ${\displaystyle mac\leftarrow AXUHash(k_{AXU},lastBlock,enc)\in W^{4}}$.
5. Update the ciphertext: ${\displaystyle e\leftarrow e||enc||I_{W^{\ast }}^{B^{\ast }}(mac\oplus mask_{m})}$.
6. ${\displaystyle i\leftarrow i+r}$.
6. Return ${\displaystyle e\,}$.

### Decryption process

Algorithm. ACE decryption process.
Input: public key ${\displaystyle (P,q,g_{1},g_{2},c,d,h_{1},h_{2},k_{1},k_{2})\,}$ and corresponding private key ${\displaystyle (w,x,y,z_{1},z_{2})\,}$, byt e string ${\displaystyle \psi \in B^{\ast }}$.
Output: Decrypted message ${\displaystyle M\in B^{\ast }\cup {Reject}}$.

1. Decrypt the ciphertext:
1. If ${\displaystyle L(\psi )<3L_{B}(P)+16\,}$, then return ${\displaystyle Reject\,}$.
2. Compute:
${\displaystyle (s,u_{1},u_{2},v,e)\leftarrow CDecode(L_{B}(P),\psi )\in W^{4}\times Z\times Z\times Z\times B^{\ast }}$;

note that ${\displaystyle 0\leq u_{1},u_{2},v<256^{l}}$, where ${\displaystyle l=L_{B}(P)\,}$.
2. Verify the ciphertext preamble:
1. If ${\displaystyle u_{1}\geq P}$ or ${\displaystyle u_{2}\geq P}$ or ${\displaystyle v\geq P}$, then return ${\displaystyle Reject\,}$.
2. If ${\displaystyle u_{1}^{q}\neq 1remP}$, then return ${\displaystyle Reject\,}$.
3. ${\displaystyle reject\leftarrow 0\,}$.
4. If ${\displaystyle u_{2}\neq u_{1}^{w}remP}$, then ${\displaystyle reject\leftarrow 1\,}$.
5. Compute ${\displaystyle \alpha \leftarrow UOWHash^{\prime }(k_{1},L_{B}(P),s,u_{1},u_{2})\in Z}$; note that ${\displaystyle 0\leq \alpha \leq 2^{160}}$.
6. If ${\displaystyle v\neq u_{1}^{x+{\alpha }y}remP}$, then ${\displaystyle reject\leftarrow 1\,}$.
7. If ${\displaystyle reject=1\,}$, then return ${\displaystyle Reject\,}$.
3. Compute the key for the symmetric decryption operation:
1. ${\displaystyle {\tilde {h_{1}}}\leftarrow u_{1}^{z_{1}}remP}$, ${\displaystyle {\tilde {h_{2}}}\leftarrow u_{1}^{z_{2}}remP}$.
2. Compute ${\displaystyle k\leftarrow ESHash(k_{2},L_{B}(P),s,u_{1},{\tilde {h_{1}}},{\tilde {h_{2}}})\in W^{8}}$.
4. Compute ${\displaystyle M\leftarrow SDec(k,s,1024,e)}$;note that ${\displaystyle SDec\,}$ can return ${\displaystyle Reject\,}$.
5. Return ${\displaystyle M\,}$.

Algorithm. Decryption operation ${\displaystyle SDec\,}$.
Input: ${\displaystyle (k,s,m,e)\in W^{8}\times W^{4}\times Z\times B^{\ast }\,}$ ${\displaystyle m>0\,}$
Output: Decrypted message ${\displaystyle M\in B^{\ast }\cup {Reject}}$.

1. If ${\displaystyle e=\lambda _{B}\,}$, then return ${\displaystyle \lambda _{B}\,}$.
2. Initialize a pseudo-random generator state:
${\displaystyle genState\leftarrow InitGen(k,s)\in GenState}$
3. Generate the key ${\displaystyle k_{AXU}AXUHash\,}$:
${\displaystyle (k_{AXU},genState^{\prime })\leftarrow GenWords((5L_{b}(\left\lceil m/64\right\rceil )+24),genState).}$.
4. ${\displaystyle M\leftarrow \lambda _{B},i\leftarrow 0}$.
5. While ${\displaystyle i, do the following:
1. ${\displaystyle r\leftarrow min(L(e)-i,m+16)-16}$.
2. If ${\displaystyle r\leq 0}$, then return ${\displaystyle Reject\,}$.
3. Generate mask values for the encryption and MAC:
1. ${\displaystyle (mask_{m},genState)\leftarrow GenWords(4,genState)}$.
2. ${\displaystyle (mask_{e},genState)\leftarrow GenWords(r,genState)}$.
4. Verify the message authentication code:
1. If ${\displaystyle i+r+16=L(M)\,}$, then ${\displaystyle lastblock\leftarrow 1}$; else ${\displaystyle lastblock\leftarrow 0}$.
2. ${\displaystyle mac\leftarrow AXUHash(k_{AXU},lastBlock,{\Bigl [}e{\Bigr ]}_{i}^{i+r})\in W^{4}}$.
3. If ${\displaystyle {\Bigl [}e{\Big ]}r_{i+r}^{i+r+16}\neq I_{W^{\ast }}^{B^{\ast }}(mac\oplus mask_{m})}$, then return ${\displaystyle Reject\,}$.
5. Update the plaintext: ${\displaystyle M\leftarrow M||({\Bigl [}e{\Bigr ]}_{i}^{i+r})\oplus mask_{e})}$.
6. ${\displaystyle i\leftarrow i+r+16}$.
6. Return ${\displaystyle M\,}$.

## Signature Scheme

The signature scheme employs two key types:
ACE Signature public key: ${\displaystyle (N,h,x,e^{\prime },k^{\prime },s)\,}$.
ACE Signature private key: ${\displaystyle (p,q,a)\,}$.
For the given size parameter ${\displaystyle m\,}$, such that ${\displaystyle 1024\leq m\leq 16384}$, key components are defined the following way:
${\displaystyle p\,}$${\displaystyle \left\lfloor m/2\right\rfloor }$-bit prime number with ${\displaystyle (p-1)/2\,}$ — is also a prime number.
${\displaystyle q\,}$${\displaystyle \left\lfloor m/2\right\rfloor }$-bit prime number with ${\displaystyle (q-1)/2\,}$ — is also a prime number.
${\displaystyle N\,}$${\displaystyle N=pq\,}$and has either ${\displaystyle m\,}$ or ${\displaystyle m-1\,}$ бит.
${\displaystyle h,x\,}$ — elements ${\displaystyle \left\{1,...,N-1\right\}}$ (quadratic residues modulo ${\displaystyle N\,}$).
${\displaystyle e^{\prime }\,}$ — 161-bit prime number.
${\displaystyle a\,}$ — element ${\displaystyle \left\{0,...,(p-1)(q-1)/4-1\right\}}$
${\displaystyle k^{\prime }\,}$ — elements ${\displaystyle B^{184}\,}$.
${\displaystyle s\,}$ — elements ${\displaystyle B^{32}\,}$.

### Key Generation

Algorithm. Key generation for the ACE public-key signature scheme.
Input: size parameter ${\displaystyle m\,}$, such that ${\displaystyle 1024\leq m\leq 16384}$.
Output: public/private key pair.

1. Generate random prime numbers${\displaystyle p,q\,}$, such that ${\displaystyle (p-1)/2\,}$ and ${\displaystyle (q-1)/2\,}$ — is also a prime number, and
${\displaystyle 2^{m_{1}-1}, ${\displaystyle 2^{m_{2}-1},
и ${\displaystyle p\neq q}$,
where
${\displaystyle m_{1}=\left\lfloor m/2\right\rfloor }$ and ${\displaystyle m_{1}=\left\lceil m/2\right\rceil }$.
2. Set ${\displaystyle N\leftarrow pq}$.
3. Generate random prime number ${\displaystyle e^{\prime }\,}$, где ${\displaystyle 2^{160}\leq e^{\prime }\leq 2^{161}}$.
4. Generate random ${\displaystyle h^{\prime }\in \left\{1,...,N-1\right\}}$, taking into account ${\displaystyle gcd(h^{\prime },N)=1}$ and ${\displaystyle gcd(h^{\prime }\pm 1,N)=1}$, and compute ${\displaystyle h\leftarrow (h^{\prime })^{-2}remN}$.
5. Generate random ${\displaystyle a\in \left\{0,...,(p-1)(q-1)/4-1\right\}}$and compute ${\displaystyle x\leftarrow h^{a}remN}$.
6. Generate random byte strings ${\displaystyle k^{\prime }\in B^{184}\,}$, and ${\displaystyle s\in B^{32}\,}$.
7. Return public key/private key pair
${\displaystyle ((N,h,x,e^{\prime },k^{\prime },s),(p,q,a))\,}$.

### Signature Representation

The signature in the ACE signature scheme has the form ${\displaystyle (d,w,y,y^{\prime },{\tilde {k}})}$, where the components are defined the following way:
${\displaystyle d\,}$ — element ${\displaystyle B^{64}\,}$.
${\displaystyle w\,}$ — integer, such that ${\displaystyle 2^{160}\leq w\leq 2^{161}}$.
${\displaystyle y,y^{\prime }\,}$ — elements ${\displaystyle \left\{1,...,N-1\right\}}$.
${\displaystyle {\tilde {k}}\,}$ — element ${\displaystyle B^{\ast }\,}$;note that ${\displaystyle L({\tilde {k}})=64+20L_{B}(\left\lceil (L(M)+8)/64\right\rceil )}$, where ${\displaystyle M\,}$ — message being signed.

We need to introduce the ${\displaystyle SEncode\,}$ function, which maps a signature into its byte string representation, and the corresponding inverse function ${\displaystyle SDecode\,}$. For integer ${\displaystyle l>0\,}$, byte string ${\displaystyle d\in B^{64}}$, integers ${\displaystyle 0\leq w\leq 256^{21}}$ and ${\displaystyle 0\leq y,y^{\prime }<256^{l}}$, and byte string ${\displaystyle {\tilde {k}}\in B^{\ast }}$,

${\displaystyle SEncode(l,d,w,y,y^{\prime },{\tilde {k}}){\stackrel {\mathrm {def} }{=}}d||pad_{21}(I_{Z}^{B^{\ast }}(w))||pad_{l}(I_{Z}^{B^{\ast }}(y))||pad_{l}(I_{Z}^{B^{\ast }}(y^{\prime }))||{\tilde {k}}\in B^{\ast }}$.

For integer ${\displaystyle l>0\,}$, byte string ${\displaystyle \sigma \in B^{\ast }}$, where ${\displaystyle L(\sigma )\geq 2l+53}$,

${\displaystyle CSecode(l,\sigma ){\stackrel {\mathrm {def} }{=}}({\Bigl [}\sigma {\Bigr ]}_{0}^{64},I_{B^{\ast }}^{Z}({\Bigl [}\sigma {\Bigr ]}_{64}^{85}),I_{B^{\ast }}^{Z}({\Bigl [}\sigma {\Bigr ]}_{85}^{85+l}),I_{B^{\ast }}^{Z}({\Bigl [}\sigma {\Bigr ]}_{85+l}^{85+2l}),{\Bigl [}\sigma {\Bigr ]}_{85+2l}^{L(\sigma )})\in B^{64}\times Z\times Z\times Z\times B^{\ast }}$.

### Signature Generation Process

Algorithm. ACE Signature Generation Process.
Input: public key ${\displaystyle (N,h,x,e^{\prime },k^{\prime },s)\,}$ and corresponding private key ${\displaystyle (p,q,a)\,}$ and byte string ${\displaystyle M\in B^{\ast }\,}$, ${\displaystyle 0\leq L(M)\leq 2^{64}}$.
Output: byte string — digital signature ${\displaystyle \sigma \in B^{\ast }\,}$.

1. Perform the following steps to hash the input data:
1. Generate a hash key ${\displaystyle {\tilde {k}}\in B^{20m+64}}$ at random, such that ${\displaystyle m=L_{b}(\left\lceil (L(M)+8)/64\right\rceil )}$.
2. Compute ${\displaystyle m_{h}\leftarrow I_{W^{\ast }}^{Z}(UOWHash^{\prime \prime }({\tilde {k}},M))}$.
2. Select ${\displaystyle {\tilde {y}}\in \left\{1,...,N-1\right\}}$ at random, and compute ${\displaystyle y^{\prime }\leftarrow {\tilde {y}}^{2}remN}$.
3. Compute ${\displaystyle x^{\prime }\leftarrow (y^{\prime })^{r^{\prime }}h^{m_{h}}remN}$.
4. Generate a random prime ${\displaystyle e\,}$, ${\displaystyle 2^{160}\leq e\leq 2^{161}}$, and its certificate of correctness ${\displaystyle (w,d)\,}$: ${\displaystyle (e,w,d)\leftarrow GenCertPrime(s)\,}$. Repeat this step until ${\displaystyle e\neq e^{\prime }\,}$.
5. Set ${\displaystyle r\leftarrow UOWHash^{\prime \prime \prime }(k^{\prime },L_{B}(N),x^{\prime },{\tilde {k}})\in Z}$; note that ${\displaystyle 0\leq r<2^{160}}$.
6. Compute ${\displaystyle y\leftarrow h^{b}remN}$, where
${\displaystyle b\leftarrow e^{-1}(a-r)rem(p^{\prime }q^{\prime })}$,

and where ${\displaystyle p^{\prime }=(p-1)/2}$ and ${\displaystyle q^{\prime }=(q-1)/2}$.
7. Encode the signature:
${\displaystyle \sigma \leftarrow SEncode(L_{B}(N),d,w,y,y^{\prime },{\tilde {k}})}$.
8. Return ${\displaystyle \sigma \,}$

## Notes

In the definition of ACE Encryption process and ACE Signature process some auxiliary function(e.g. UOWHash,ESHash and some other) are being used, definition of which goes beyond this article. You cand find more details about it in в.[1]

## Implementation, Utilization and Performance

ACE Encryption scheme is recommended by NESSIE (New European Schemes for Signatures, Integrity and Encryption) as asymmetric encryption scheme. Press-release is dated by February 2003.

Both schemes were implemented in ANSI C, with the use of GNU GMP library. Tests were done on two platforms: Power PC 604 model 43P under AIX system and 266 MHz Pentium under Windows NT system. Result tables:

Table 1. Time costs on basic operations.

 Power PC Pentium Operand size(byte) Operand size(byte) 512 1024 512 1024 Multiplication 3.5 * 10^(-5) sec 1.0 * 10^(-4) sec 4.5 * 10^(-5) sec 1.4 * 10^(-4) sec Squaring 3.3 * 10^(-5) sec 1.0 * 10^(-4) sec 4.4 * 10^(-5) sec 1.4 * 10^(-4) sec Exponentiation 1.9 * 10^(-2) sec 1.2 * 10^(-1) sec 2.6 * 10^(-2) sec 1.7 * 10^(-1) sec

Table 2. Performance of encryption scheme and signature scheme.

 Power PC Pentium Fixed costs (ms) MBit/sec Fixed costs (ms) MBit/sec Encrypt 160 18 230 16 Decrypt 68 18 97 14 Sign 48 64 62 52 Sign set-up 29 41 Verify 52 65 73 53