ホーム › Security.Cryptography › INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| inputBlockSize | INT | 4 | +0 | +0 | 変換の入力ブロックサイズ(バイト)。 |
| outputBlockSize | INT | 4 | +4 | +4 | 変換の出力ブロックサイズ(バイト)。 |
| canTransformMultipleBlocks | BOOL | 4 | +8 | +8 | 複数ブロックを一括変換可能かを示すBOOL。 |
| canReuseTransform | BOOL | 4 | +12 | +12 | 変換オブジェクトを再利用可能かを示すBOOL。 |
各言語での定義
#include <windows.h>
// INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS (x64 16 / x86 16 バイト)
typedef struct INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS {
INT inputBlockSize;
INT outputBlockSize;
BOOL canTransformMultipleBlocks;
BOOL canReuseTransform;
} INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
{
public int inputBlockSize;
public int outputBlockSize;
[MarshalAs(UnmanagedType.Bool)] public bool canTransformMultipleBlocks;
[MarshalAs(UnmanagedType.Bool)] public bool canReuseTransform;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
Public inputBlockSize As Integer
Public outputBlockSize As Integer
<MarshalAs(UnmanagedType.Bool)> Public canTransformMultipleBlocks As Boolean
<MarshalAs(UnmanagedType.Bool)> Public canReuseTransform As Boolean
End Structureimport ctypes
from ctypes import wintypes
class INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS(ctypes.Structure):
_fields_ = [
("inputBlockSize", ctypes.c_int),
("outputBlockSize", ctypes.c_int),
("canTransformMultipleBlocks", wintypes.BOOL),
("canReuseTransform", wintypes.BOOL),
]#[repr(C)]
pub struct INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS {
pub inputBlockSize: i32,
pub outputBlockSize: i32,
pub canTransformMultipleBlocks: i32,
pub canReuseTransform: i32,
}import "golang.org/x/sys/windows"
type INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS struct {
inputBlockSize int32
outputBlockSize int32
canTransformMultipleBlocks int32
canReuseTransform int32
}type
INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS = record
inputBlockSize: Integer;
outputBlockSize: Integer;
canTransformMultipleBlocks: BOOL;
canReuseTransform: BOOL;
end;const INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS = extern struct {
inputBlockSize: i32,
outputBlockSize: i32,
canTransformMultipleBlocks: i32,
canReuseTransform: i32,
};type
INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS {.bycopy.} = object
inputBlockSize: int32
outputBlockSize: int32
canTransformMultipleBlocks: int32
canReuseTransform: int32struct INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
{
int inputBlockSize;
int outputBlockSize;
int canTransformMultipleBlocks;
int canReuseTransform;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; inputBlockSize : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; outputBlockSize : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; canTransformMultipleBlocks : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; canReuseTransform : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS
#field int inputBlockSize
#field int outputBlockSize
#field bool canTransformMultipleBlocks
#field bool canReuseTransform
#endstruct
stdim st, INFORMATIONCARD_TRANSFORM_CRYPTO_PARAMETERS ; NSTRUCT 変数を確保
st->inputBlockSize = 100
mes "inputBlockSize=" + st->inputBlockSize