TrustCore SDK NanoCrypto API reference  version 7.0
arc2.h File Reference

Header file for the NanoCrypto RC2 Internal APIs. More...

Go to the source code of this file.

Functions

MOC_EXTERN void rc2_decrypt (const ubyte2 xkey[64], ubyte *plain, const ubyte *cipher)
 Decrypts a 64 bit block of data. More...
 
MOC_EXTERN void rc2_encrypt (const ubyte2 xkey[64], const ubyte *plain, ubyte *cipher)
 Encrypts a 64 bit block of data. More...
 
MOC_EXTERN void rc2_keyschedule (ubyte2 xkey[64], const ubyte *key, ubyte4 len, ubyte4 bits)
 Computes the rc2 key schedule. More...
 

Detailed Description

This file contains the NanoCrypto RC2 Internal API methods.

To enable the NanoCrypto RC2 functions, the following flag must be defined in moptions.h:

  • __ENABLE_ARC2_CIPHERS__

Additionally, the following flag must not be defined:

  • __ARC2_HARDWARE_CIPHER__

arc2.h

Function Documentation

◆ rc2_decrypt()

MOC_EXTERN void rc2_decrypt ( const ubyte2  xkey[64],
ubyte *  plain,
const ubyte *  cipher 
)

Decrypts a 64 bit block of data.

To enable the NanoCrypto RC2 functions, the following flag must be defined

  • __ENABLE_ARC2_CIPHERS__
Parameters
xkeyThe key schedule to be used to decrypt the data.
plainBuffer that will hold the resulting 64 bits (8 bytes) of plaintext.
cipherBuffer holding the 64 bit (8 byte) block of data to be decrypted.

arc2.h

◆ rc2_encrypt()

MOC_EXTERN void rc2_encrypt ( const ubyte2  xkey[64],
const ubyte *  plain,
ubyte *  cipher 
)

Encrypts a 64 bit block of data.

To enable the NanoCrypto RC2 functions, the following flag must be defined

  • __ENABLE_ARC2_CIPHERS__
Parameters
xkeyThe key schedule to be used to encrypt the data.
plainBuffer holding the 64 bit (8 byte) block of data to be encrypted.
cipherBuffer that will hold the resulting 64 bits (8 bytes) of ciphertext.

arc2.h

◆ rc2_keyschedule()

MOC_EXTERN void rc2_keyschedule ( ubyte2  xkey[64],
const ubyte *  key,
ubyte4  len,
ubyte4  bits 
)

Computes the rc2 key schedule.

To enable the NanoCrypto RC2 functions, the following flag must be defined

  • __ENABLE_ARC2_CIPHERS__
Parameters
xkeyWill hold the resulting 128 bit key schedule.
keyBuffer holding the input key.
lenThe length of the key in bytes.
bitsThe requested effective key bits.

arc2.h