mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
cipurse crypto sketch
This commit is contained in:
parent
b309fe519b
commit
ce2b22a6a7
2 changed files with 65 additions and 0 deletions
23
client/src/cipurse/cipursecrypto.c
Normal file
23
client/src/cipurse/cipursecrypto.c
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2021 Merlok
|
||||||
|
//
|
||||||
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||||
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||||
|
// the license.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// CIPURSE crypto primitives
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "cipursecore.h"
|
||||||
|
|
||||||
|
#include "commonutil.h" // ARRAYLEN
|
||||||
|
#include "comms.h" // DropField
|
||||||
|
#include "util_posix.h" // msleep
|
||||||
|
|
||||||
|
#include "cmdhf14a.h"
|
||||||
|
#include "emv/emvcore.h"
|
||||||
|
#include "emv/emvjson.h"
|
||||||
|
#include "ui.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
|
42
client/src/cipurse/cipursecrypto.h
Normal file
42
client/src/cipurse/cipursecrypto.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2021 Merlok
|
||||||
|
//
|
||||||
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||||
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||||
|
// the license.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// CIPURSE crypto primitives
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef __CIPURSECRYPTO_H__
|
||||||
|
#define __CIPURSECRYPTO_H__
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
enum CipurseChannelSecurityLevel {
|
||||||
|
CPSNone,
|
||||||
|
CPSPlain,
|
||||||
|
CPSMACed,
|
||||||
|
CPSEncrypted
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CipurseSession {
|
||||||
|
uint8_t keyId,
|
||||||
|
uint8_t[16] key,
|
||||||
|
|
||||||
|
uint8_t[16] RP,
|
||||||
|
uint8_t[6] rP,
|
||||||
|
uint8_t[16] RT,
|
||||||
|
uint8_t[6] rT,
|
||||||
|
|
||||||
|
uint8_t[16] k0,
|
||||||
|
uint8_t[16] cP,
|
||||||
|
|
||||||
|
uint8_t[16] frameKey,
|
||||||
|
uint8_t[16] frameKey1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __CIPURSECRYPTO_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue