OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions | Variables
gost89.c File Reference
#include <string.h>
#include "gost89.h"

Go to the source code of this file.

Functions

void gostcrypt (gost_ctx *c, const byte *in, byte *out)
 
void gostdecrypt (gost_ctx *c, const byte *in, byte *out)
 
void gost_enc (gost_ctx *c, const byte *clear, byte *cipher, int blocks)
 
void gost_dec (gost_ctx *c, const byte *cipher, byte *clear, int blocks)
 
void gost_enc_cfb (gost_ctx *ctx, const byte *iv, const byte *clear, byte *cipher, int blocks)
 
void gost_dec_cfb (gost_ctx *ctx, const byte *iv, const byte *cipher, byte *clear, int blocks)
 
void gost_enc_with_key (gost_ctx *c, byte *key, byte *inblock, byte *outblock)
 
void gost_key (gost_ctx *c, const byte *k)
 
void gost_get_key (gost_ctx *c, byte *k)
 
void gost_init (gost_ctx *c, const gost_subst_block *b)
 
void gost_destroy (gost_ctx *c)
 
void mac_block (gost_ctx *c, byte *buffer, const byte *block)
 
void get_mac (byte *buffer, int nbits, byte *out)
 
int gost_mac (gost_ctx *ctx, int mac_len, const unsigned char *data, unsigned int data_len, unsigned char *mac)
 
int gost_mac_iv (gost_ctx *ctx, int mac_len, const unsigned char *iv, const unsigned char *data, unsigned int data_len, unsigned char *mac)
 
void cryptopro_key_meshing (gost_ctx *ctx, unsigned char *iv)
 

Variables

gost_subst_block GostR3411_94_TestParamSet
 
gost_subst_block GostR3411_94_CryptoProParamSet
 
gost_subst_block Gost28147_TestParamSet
 
gost_subst_block Gost28147_CryptoProParamSetA
 
gost_subst_block Gost28147_CryptoProParamSetB
 
gost_subst_block Gost28147_CryptoProParamSetC
 
gost_subst_block Gost28147_CryptoProParamSetD
 
const byte CryptoProKeyMeshingKey []
 

Function Documentation

void cryptopro_key_meshing ( gost_ctx ctx,
unsigned char *  iv 
)

Definition at line 398 of file gost89.c.

void get_mac ( byte buffer,
int  nbits,
byte out 
)

Definition at line 347 of file gost89.c.

void gost_dec ( gost_ctx c,
const byte cipher,
byte clear,
int  blocks 
)

Definition at line 217 of file gost89.c.

void gost_dec_cfb ( gost_ctx ctx,
const byte iv,
const byte cipher,
byte clear,
int  blocks 
)

Definition at line 247 of file gost89.c.

void gost_destroy ( gost_ctx c)

Definition at line 306 of file gost89.c.

void gost_enc ( gost_ctx c,
const byte clear,
byte cipher,
int  blocks 
)

Definition at line 206 of file gost89.c.

void gost_enc_cfb ( gost_ctx ctx,
const byte iv,
const byte clear,
byte cipher,
int  blocks 
)

Definition at line 229 of file gost89.c.

void gost_enc_with_key ( gost_ctx c,
byte key,
byte inblock,
byte outblock 
)

Definition at line 266 of file gost89.c.

void gost_get_key ( gost_ctx c,
byte k 
)

Definition at line 283 of file gost89.c.

void gost_init ( gost_ctx c,
const gost_subst_block b 
)

Definition at line 296 of file gost89.c.

void gost_key ( gost_ctx c,
const byte k 
)

Definition at line 273 of file gost89.c.

int gost_mac ( gost_ctx ctx,
int  mac_len,
const unsigned char *  data,
unsigned int  data_len,
unsigned char *  mac 
)

Definition at line 359 of file gost89.c.

int gost_mac_iv ( gost_ctx ctx,
int  mac_len,
const unsigned char *  iv,
const unsigned char *  data,
unsigned int  data_len,
unsigned char *  mac 
)

Definition at line 378 of file gost89.c.

void gostcrypt ( gost_ctx c,
const byte in,
byte out 
)

Definition at line 140 of file gost89.c.

void gostdecrypt ( gost_ctx c,
const byte in,
byte out 
)

Definition at line 173 of file gost89.c.

void mac_block ( gost_ctx c,
byte buffer,
const byte block 
)

Definition at line 318 of file gost89.c.

Variable Documentation

const byte CryptoProKeyMeshingKey[]
Initial value:
={
0x69, 0x00, 0x72, 0x22, 0x64, 0xC9, 0x04, 0x23,
0x8D, 0x3A, 0xDB, 0x96, 0x46, 0xE9, 0x2A, 0xC4,
0x18, 0xFE, 0xAC, 0x94, 0x00, 0xED, 0x07, 0x12,
0xC0, 0x86, 0xDC, 0xC2, 0xEF, 0x4C, 0xA9, 0x2B
}

Definition at line 110 of file gost89.c.

gost_subst_block Gost28147_CryptoProParamSet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,0x7,0x3,0xF,0xB,0x8,0x6,0xE},
{0x8,0x4,0xB,0x1,0x3,0x5,0x0,0x9,0x2,0xE,0xA,0xC,0xD,0x6,0x7,0xF}
}

Definition at line 72 of file gost89.c.

gost_subst_block Gost28147_CryptoProParamSetC
Initial value:
=
{
{0x7,0x4,0x0,0x5,0xA,0x2,0xF,0xE,0xC,0x6,0x1,0xB,0xD,0x9,0x3,0x8},
{0xA,0x9,0x6,0x8,0xD,0xE,0x2,0x0,0xF,0x3,0x5,0xB,0x4,0x1,0xC,0x7},
{0xC,0x9,0xB,0x1,0x8,0xE,0x2,0x4,0x7,0x3,0x6,0x5,0xA,0x0,0xF,0xD},
{0x8,0xD,0xB,0x0,0x4,0x5,0x1,0x2,0x9,0x3,0xC,0xE,0x6,0xF,0xA,0x7},
{0x3,0x6,0x0,0x1,0x5,0xD,0xA,0x8,0xB,0x2,0x9,0x7,0xE,0xF,0xC,0x4},
{0x8,0x2,0x5,0x0,0x4,0x9,0xF,0xA,0x3,0x7,0xC,0xD,0x6,0xE,0x1,0xB},
{0x0,0x1,0x7,0xD,0xB,0x4,0x5,0x2,0x8,0xE,0xF,0xC,0x9,0xA,0x6,0x3},
{0x1,0xB,0xC,0x2,0x9,0xD,0x0,0xF,0x4,0x5,0x8,0xE,0xA,0x7,0x6,0x3}
}

Definition at line 84 of file gost89.c.

gost_subst_block Gost28147_CryptoProParamSetD
Initial value:
=
{
{0x1,0xA,0x6,0x8,0xF,0xB,0x0,0x4,0xC,0x3,0x5,0x9,0x7,0xD,0x2,0xE},
{0x3,0x0,0x6,0xF,0x1,0xE,0x9,0x2,0xD,0x8,0xC,0x4,0xB,0xA,0x5,0x7},
{0x8,0x0,0xF,0x3,0x2,0x5,0xE,0xB,0x1,0xA,0x4,0x7,0xC,0x9,0xD,0x6},
{0x0,0xC,0x8,0x9,0xD,0x2,0xA,0xB,0x7,0x3,0x6,0x5,0x4,0xE,0xF,0x1},
{0x1,0x5,0xE,0xC,0xA,0x7,0x0,0xD,0x6,0x2,0xB,0x4,0x9,0x3,0xF,0x8},
{0x1,0xC,0xB,0x0,0xF,0xE,0x6,0x5,0xA,0xD,0x4,0x8,0x9,0x3,0x7,0x2},
{0xB,0x6,0x3,0x4,0xC,0xF,0xE,0x2,0x7,0xD,0x8,0x0,0x5,0xA,0x9,0x1},
{0xF,0xC,0x2,0xA,0x6,0x4,0x5,0x0,0x7,0x9,0xE,0xD,0x1,0xB,0x8,0x3}
}

Definition at line 97 of file gost89.c.

gost_subst_block Gost28147_TestParamSet
Initial value:
=
{
{0xC,0x6,0x5,0x2,0xB,0x0,0x9,0xD,0x3,0xE,0x7,0xA,0xF,0x4,0x1,0x8},
{0x9,0xB,0xC,0x0,0x3,0x6,0x7,0x5,0x4,0x8,0xE,0xF,0x1,0xA,0x2,0xD},
{0x8,0xF,0x6,0xB,0x1,0x9,0xC,0x5,0xD,0x3,0x7,0xA,0x0,0xE,0x2,0x4},
{0x3,0xE,0x5,0x9,0x6,0x8,0x0,0xD,0xA,0xB,0x7,0xC,0x2,0x1,0xF,0x4},
{0xE,0x9,0xB,0x2,0x5,0xF,0x7,0x1,0x0,0xD,0xC,0x6,0xA,0x4,0x3,0x8},
{0xD,0x8,0xE,0xC,0x7,0x3,0x9,0xA,0x1,0x5,0x2,0x4,0x6,0xF,0x0,0xB},
{0xC,0x9,0xF,0xE,0x8,0x1,0x3,0xA,0x2,0x7,0x4,0xD,0x6,0x0,0xB,0x5},
{0x4,0x2,0xF,0x5,0x9,0x1,0x0,0x8,0xE,0x3,0xB,0xC,0xD,0x7,0xA,0x6}
}

Definition at line 45 of file gost89.c.

gost_subst_block GostR3411_94_CryptoProParamSet
Initial value:
= {
{0x1,0x3,0xA,0x9,0x5,0xB,0x4,0xF,0x8,0x6,0x7,0xE,0xD,0x0,0x2,0xC},
{0xD,0xE,0x4,0x1,0x7,0x0,0x5,0xA,0x3,0xC,0x8,0xF,0x6,0x2,0x9,0xB},
{0x7,0x6,0x2,0x4,0xD,0x9,0xF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