123456789101112131415161718192021222324(* Claude Code
*
* Copyright (C) 2026 Yoann Padioleau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* (LGPL) as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*)(* See Hkdf.mli *)letextract~(hmac:string->string->string)~(salt:string)(ikm:string):string=hmacsaltikmletexpand~(hmac:string->string->string)(prk:string)~(info:string)(length:int):string=letout=Buffer.createlengthinletrecgoti=ifBuffer.lengthout<lengththen(lett=hmacprk(t^info^String.make1(Char.chri))inBuffer.add_stringoutt;got(i+1))ingo""1;Buffer.subout0length