Software:ACE Encrypt

From HandWiki

ACE (advanced cryptographic engine) is 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

Here we introduce some notations, being used in this article.

Basic mathematical notation

[math]\displaystyle{ \Z }[/math] — The set of integers.
[math]\displaystyle{ F_2[T] }[/math] — The set of univariate polynomials with coefficients in the finite field [math]\displaystyle{ F_2 }[/math] of cardinality 2.
[math]\displaystyle{ A \operatorname{rem} n }[/math] — integer [math]\displaystyle{ r \in \left\{0,\dots,n-1\right\} }[/math] such that [math]\displaystyle{ A\equiv r\pmod n }[/math] for integer [math]\displaystyle{ n\gt 0 }[/math] and [math]\displaystyle{ A \in \Z }[/math].
[math]\displaystyle{ A \operatorname{rem} f }[/math] — polynomial [math]\displaystyle{ r \in F_2[T] }[/math] with [math]\displaystyle{ \deg(r) \lt \deg(f) }[/math] such that [math]\displaystyle{ A\equiv r\pmod f }[/math] with [math]\displaystyle{ A,f \in F_2[T],f \ne 0 }[/math].

Basic string notation

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

Bits, Bytes, Words

[math]\displaystyle{ b\overset{\text{def}}{{}={}}\left\{0,1\right\} }[/math] — The set of bits.
Let us take all sets of form [math]\displaystyle{ b, b^{n_1}, (b^{n_1})^{n_2},... }[/math]. For such a set A we define the "zero element":

[math]\displaystyle{ 0_b\stackrel{\mathrm{def}}{=}0 \in b }[/math];
[math]\displaystyle{ 0_{A^n}\stackrel{\mathrm{def}}{=}(0_A,...,0_A) \in A^n }[/math] for [math]\displaystyle{ n\gt 0 }[/math].

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

For [math]\displaystyle{ x \in A^{\ast} }[/math] with [math]\displaystyle{ A \in \left\{b,B,W\right\} }[/math] and [math]\displaystyle{ l\gt 0 }[/math] we define a padding operator:

[math]\displaystyle{ pad_l(x) \stackrel{\mathrm{def}}{=} \begin{cases} x, & L(x) \ge l \\ x||0_{A^{l-L(x)}}, & L(x)\lt l \end{cases} }[/math].

Conversion operator

Conversion operator [math]\displaystyle{ I_{src}^{dst}: src \to dst }[/math] makes a conversion between elements [math]\displaystyle{ Z,F_2[T],b^{\ast},B^{\ast},W^{\ast} }[/math].

Encryption Scheme

Encryption Key Pair

The encryption scheme employs two key types:
ACE public key: [math]\displaystyle{ (P,q,g_1,g_2,c,d,h_1,h_2,k_1,k_2) }[/math].
ACE private key: [math]\displaystyle{ (w,x,y,z_1,z_2) }[/math].
For a given size parameter [math]\displaystyle{ m }[/math], such that [math]\displaystyle{ 1024 \le m \le 16384 }[/math], key components are defined as:
[math]\displaystyle{ q }[/math] — a 256-bit prime number.
[math]\displaystyle{ P }[/math] — a m-bit prime number, such that [math]\displaystyle{ P\equiv 1\pmod q }[/math].
[math]\displaystyle{ g_1,g_2,c,d,h_1,h_2 }[/math] — elements [math]\displaystyle{ \left\{1,\dots,P-1\right\} }[/math] (whose multiplicative order modulo [math]\displaystyle{ P }[/math] divides [math]\displaystyle{ q }[/math]).
[math]\displaystyle{ w,x,y,z_1,z_2 }[/math] — elements [math]\displaystyle{ \left\{0,\dots,q-1\right\} }[/math].
[math]\displaystyle{ k_1,k_2 }[/math] — elements [math]\displaystyle{ B^\ast }[/math] with [math]\displaystyle{ L(k_1)=20l'+64 }[/math] and [math]\displaystyle{ L(k_2)=32\left\lceil l/16 \right\rceil+40 }[/math], where [math]\displaystyle{ l=\left\lceil m/8 \right\rceil }[/math] and [math]\displaystyle{ l'=L_b(\left\lceil (2\left\lceil l/4 \right\rceil +4)/16 \right\rceil) }[/math].

Key Generation

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

  1. Generate a random prime [math]\displaystyle{ q }[/math], such that [math]\displaystyle{ 2^{255} \lt q \lt 2^{256} }[/math].
  2. Generate a random prime [math]\displaystyle{ P }[/math], [math]\displaystyle{ 2^{m-1} \lt P \lt 2^{m} }[/math], such that [math]\displaystyle{ P\equiv1(mod q) }[/math].
  3. Generate a random integer [math]\displaystyle{ g_1 \in \left\{ 2,...,P-1 \right\} }[/math], such that [math]\displaystyle{ g_1^q\equiv1(mod P) }[/math].
  4. Generate random integers [math]\displaystyle{ w \in \left\{ 1,...,q-1 \right\} }[/math] and [math]\displaystyle{ x,y,z_1,z_2 \in \left\{ 0,...,q-1 \right\} }[/math]
  5. Compute the following integers in [math]\displaystyle{ \left\{ 1,...,P-1 \right\} }[/math]:
    [math]\displaystyle{ g_2 \leftarrow g_1^w rem P }[/math],
    [math]\displaystyle{ c \leftarrow g_1^x rem P }[/math],
    [math]\displaystyle{ d \leftarrow g_1^y rem P }[/math],
    [math]\displaystyle{ h_1 \leftarrow g_1^{z_1} rem P }[/math],
    [math]\displaystyle{ h_2 \leftarrow g_1^{z_2} rem P }[/math].
  6. Generate random byte strings [math]\displaystyle{ k_1 \in B^{20l'+64} }[/math] and [math]\displaystyle{ k_2 \in B^{2\left\lceil l/16 \right\rceil+40} }[/math], where [math]\displaystyle{ l=L_B(P) }[/math] and [math]\displaystyle{ l' = L_B(\left\lceil (2\left\lceil l/4 \right\rceil +4)/16 \right\rceil) }[/math].
  7. Return the public key/private key pair
    [math]\displaystyle{ ((P,q,g_1,g_2,c,d,h_1,h_2,k_1,k_2),(w,x,y,z_1,z_2)) }[/math]

Ciphertext Representation

A ciphertext of the ACE encryption scheme has the form

[math]\displaystyle{ (s,u_1,u_2,v,e) }[/math],


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

representation, and the corresponding inverse function [math]\displaystyle{ CDecode }[/math]. For the integer [math]\displaystyle{ l\gt 0 }[/math], word string [math]\displaystyle{ s \in W^4 }[/math], integers [math]\displaystyle{ 0 \le u_1,u_2,v\lt 256^l }[/math], and byte string [math]\displaystyle{ e \in B^{\ast} }[/math],

[math]\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} }[/math].


For integer [math]\displaystyle{ l\gt 0 }[/math], byte string [math]\displaystyle{ \psi \in B^{\ast} }[/math], such that [math]\displaystyle{ L(\psi) \ge 3l+16 }[/math],

[math]\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} }[/math].

Encryption Process

Algorithm. ACE asymmetric encryption operation.
input: public key [math]\displaystyle{ (P,q,g_1,g_2,c,d,h_1,h_2,k_1,k_2) }[/math] and byte string [math]\displaystyle{ M \in B^{\ast} }[/math].
Output: byte string — ciphertext [math]\displaystyle{ \psi\ }[/math] of [math]\displaystyle{ M }[/math].

  1. Generate [math]\displaystyle{ r \in \left\{ 0,...,q-1 \right\} }[/math] at random.
  2. Generate the ciphertext preamble:
    1. Generate [math]\displaystyle{ s \in W^4 }[/math] at random.
    2. Compute [math]\displaystyle{ u_1 \leftarrow g_1^r rem P }[/math], [math]\displaystyle{ u_2 \leftarrow g_2^r rem P }[/math].
    3. Compute [math]\displaystyle{ \alpha\ \leftarrow UOWHash^\prime (k_1,L_B(P),s,u_1,u_2) \in Z }[/math]; note that [math]\displaystyle{ 0 \lt \alpha\ \lt 2^{160} }[/math].
    4. Compute [math]\displaystyle{ v \leftarrow c^r d^{\alpha\ r} rem P }[/math].
  3. Compute the key for the symmetric encryption operation:
    1. [math]\displaystyle{ \tilde{h_1} \leftarrow h_1^r rem P }[/math], [math]\displaystyle{ \tilde{h_2} \leftarrow h_2^r rem P }[/math].
    2. Compute [math]\displaystyle{ k \leftarrow ESHash(k,L_B(P),s,u_1,u_2,\tilde{h_1},\tilde{h_2}) \in W^8 }[/math].
  4. Compute cryptogram [math]\displaystyle{ e \leftarrow SEnc(k,s,1024,M) }[/math].
  5. Encode the ciphertext:
    [math]\displaystyle{ \psi\ \leftarrow CEncode(L_B(P),s,u_1,u_2,v,e) }[/math].
  6. Return [math]\displaystyle{ \psi\ }[/math].

Before starting off the symmetric encryption process, the input message [math]\displaystyle{ M \in B^{\ast} }[/math] is divided into blocks [math]\displaystyle{ M_1,...,M_t }[/math], 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 [math]\displaystyle{ E_i }[/math] 16-byte message authentication code is computed. We get the cryptogram

[math]\displaystyle{ e=E_1||C_1||...||E_t||C_t }[/math].[math]\displaystyle{ L(e)=L(M)+16\left\lceil L(M)/m \right\rceil }[/math].

Note that if [math]\displaystyle{ L(M)=0 }[/math], then [math]\displaystyle{ L(e)=0 }[/math].

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

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

Decryption process

Algorithm. ACE decryption process.
Input: public key [math]\displaystyle{ (P,q,g_1,g_2,c,d,h_1,h_2,k_1,k_2) }[/math] and corresponding private key [math]\displaystyle{ (w,x,y,z_1,z_2) }[/math], byt e string [math]\displaystyle{ \psi \in B^{\ast} }[/math].
Output: Decrypted message [math]\displaystyle{ M \in B^{\ast} \cup {Reject} }[/math].

  1. Decrypt the ciphertext:
    1. If [math]\displaystyle{ L(\psi) \lt 3L_B(P)+16 }[/math], then return [math]\displaystyle{ Reject }[/math].
    2. Compute:
      [math]\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} }[/math];

      note that [math]\displaystyle{ 0 \le u_1,u_2,v\lt 256^l }[/math], where [math]\displaystyle{ l=L_B(P) }[/math].
  2. Verify the ciphertext preamble:
    1. If [math]\displaystyle{ u_1 \ge P }[/math] or [math]\displaystyle{ u_2 \ge P }[/math] or [math]\displaystyle{ v \ge P }[/math], then return [math]\displaystyle{ Reject }[/math].
    2. If [math]\displaystyle{ u_1^q \ne 1 rem P }[/math], then return [math]\displaystyle{ Reject }[/math].
    3. [math]\displaystyle{ reject \leftarrow 0 }[/math].
    4. If [math]\displaystyle{ u_2 \ne u_1^w rem P }[/math], then [math]\displaystyle{ reject \leftarrow 1 }[/math].
    5. Compute [math]\displaystyle{ \alpha \leftarrow UOWHash^{\prime}(k_1,L_B(P),s,u_1,u_2) \in Z }[/math]; note that [math]\displaystyle{ 0 \le \alpha \le 2^{160} }[/math].
    6. If [math]\displaystyle{ v \ne u_1^{x+{\alpha}y} rem P }[/math], then [math]\displaystyle{ reject \leftarrow 1 }[/math].
    7. If [math]\displaystyle{ reject=1 }[/math], then return [math]\displaystyle{ Reject }[/math].
  3. Compute the key for the symmetric decryption operation:
    1. [math]\displaystyle{ \tilde{h_1} \leftarrow u_1^{z_1} rem P }[/math], [math]\displaystyle{ \tilde{h_2} \leftarrow u_1^{z_2} rem P }[/math].
    2. Compute [math]\displaystyle{ k \leftarrow ESHash(k_2,L_B(P),s,u_1,\tilde{h_1},\tilde{h_2}) \in W^8 }[/math].
  4. Compute [math]\displaystyle{ M \leftarrow SDec(k,s,1024,e) }[/math];note that [math]\displaystyle{ SDec }[/math] can return [math]\displaystyle{ Reject }[/math].
  5. Return [math]\displaystyle{ M }[/math].

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

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

Signature Scheme

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

Key Generation

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

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

Signature Representation

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

We need to introduce the [math]\displaystyle{ SEncode }[/math] function, which maps a signature into its byte string representation, and the corresponding inverse function [math]\displaystyle{ SDecode }[/math]. For integer [math]\displaystyle{ l\gt 0 }[/math], byte string [math]\displaystyle{ d \in B^{64} }[/math], integers [math]\displaystyle{ 0 \le w \le 256^{21} }[/math] and [math]\displaystyle{ 0 \le y,y'\lt 256^l }[/math], and byte string [math]\displaystyle{ \tilde{k} \in B^{\ast} }[/math],

[math]\displaystyle{ SEncode(l,d,w,y,y',\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'))||\tilde{k} \in B^{\ast} }[/math].


For integer [math]\displaystyle{ l\gt 0 }[/math], byte string [math]\displaystyle{ \sigma \in B^{\ast} }[/math], where [math]\displaystyle{ L(\sigma) \ge 2l+53 }[/math],

[math]\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} }[/math].

Signature Generation Process

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

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

    and where [math]\displaystyle{ p'=(p-1)/2 }[/math] and [math]\displaystyle{ q'=(q-1)/2 }[/math].
  7. Encode the signature:
    [math]\displaystyle{ \sigma \leftarrow SEncode(L_B(N),d,w,y,y',\tilde{k}) }[/math].
  8. Return [math]\displaystyle{ \sigma }[/math]

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. More details about it can be found 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:

Time costs on basic operations
Power PC Pentium
Operand size(byte) Operand size(byte)
512 1024 512 1024
Multiplication 3.5×10−5 s 1.0×10−4 s 4.5×10−5 s 1.4×10−4 s
Squaring 3.3×10−5 s 1.0×10−4 s 4.4×10−5 s 1.4×10−4 s
Exponentiation 1.9×10−2 s 1.2×10−1 s 2.6×10−2 s 1.7×10−1 s
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

Literature

External links