INTRODUCTION
This application note describes the general use of the
PIC12F635/PIC16F636/PIC16F639
module. Technical Brief TB076, “Using the K
Compatible Cryptographical Module” (DS91076) and
the
Agreement are needed to use the Cryptographic
module.
Obtaining TB076 requires the completion of a licensing
agreement that must be obtained through the Microchip
Technology Inc. web site (www.microchip.com) and
approved by the Microchip Technology Inc. Legal
Department. The agreement form is located under the
K
site (www.microchip.com/keeloq).
Technical Brief TB076 describes how to implement
cryptography on these products using the hardware
peripheral. The Cryptographic module is capable of
handling K
well as application specific encoding/decoding.
After receiving approval by the Microchip Technology
Legal Department, customers will receive Application
Note AN249, “K
PIC12F6XX” (DS00249) as well as the TB076 Technical
Brief on a CD ROM. Additionally, the disk includes
firmware implementations of the K
algorithm for PIC12, PIC16 and PIC18 devices with
minor modifications, the algorithms for the PIC12 and
PIC16 devices can be adapted to the PIC10 series of
PICmicro
Additionally,
decoding routines on PICmicro microcontrollers are also
available by ordering the K
Please contact your local Microchip Technology sales
office to order this CD-ROM.
© 2005 Microchip Technology Inc.
PIC12F635/PIC16F636/PIC16F639 Cryptographic Module General Overview
Author:
EE
Note:
L
OQ
corresponding
®
®
Authentication Products section of our web
EE
microcontrollers.
If the PIC12F635/PIC16F636/PIC16F639
devices are designed into a system
without using the K
Cryptographic module, then a licensing
agreement is not required.
Ken Dietz
Microchip Technology Inc.
L
firmware
OQ
EE
®
L
compatible encoding/decoding, as
OQ
K
®
EE
libraries
Transmitter Shell Using the
EE
L
OQ
L
OQ
®
CD-ROM (DS40038).
EE
Encoder
for
EE
L
OQ
L
OQ
Cryptographic
implementing
Compatible
encryption
EE
License
L
OQ
®
CRYPTOGRAPHIC MODULE
FEATURES
The PIC12F635/PIC16F636/PIC16F639 devices can
be used as encoders or decoders based on the
configuration
cryptographic peripheral only does the actual data
encryption and decryption. The peripheral requires that
the following internal RAM locations are initialized
before starting a K
1.
2.
3.
FIGURE 1:
The conversion is then started by setting the GO/DONE
bit in CRCON register and waiting for it to be cleared by
the hardware. The peripheral can also generate an
interrupt if enabled, which can also be used to poll for the
end of the cryptographic process.
A main program in the C language will typically look like
Example 1.
EXAMPLE 1:
void main(){
Load_Encryption_Key()
Load_ICR()
Load_CSR()
//Start conversion by setting GO/DONE bit
//Wait for interrupt or GO/DONE to be cleared
}
Load a 64-bit encryption/decryption key into
KEY<7:0>. This is completed in two 32-bit steps
through the use of the CRCON and CRDAT<3:0>
registers.
Load the Iteration Counter (ICR). This is also
loaded through the CRCON and CRDAT0
register.
Load of the actual 32 bits of data using the
CRCON and CRDAT<3:0> registers.
.
.
.
32-Bit Value
.
.
.
settings
EE
Encryption Key
CRYPTOGRAPHIC MODULE
L
OQ
Cipher
32-Bit
Block
64-Bit
compatible conversion:
of
the
TB086
Encoded/Decoded
peripheral.
DS91086A-page 1
32-Bit
Value
The